In one of my chef recipes, i am trying to upgrade the nss package, like this.
include_recipe 'yum'
package 'nss' do
action :upgrade
end
include_recipe 'yum-epel'
I notice that the chef-client fails to converge with the below error.
ERROR: package[nss] (123AB_cookbook::default line 12) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
STDOUT: [option installonlypkgs] kernel kernel-bigmem installonlypkg(kernel-module) installonlypkg(vm) kernel-enterprise kernel-smp kernel-debug kernel-unsupported kernel-source kernel-devel kernel-PAE kernel-PAE-debug
STDERR: yum-dump Repository Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4/lib/chef/provider/package/yum-dump.py --options --installed-provides returned 1
[2015-03-09T18:28:38+00:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2015-03-09T18:28:38+00:00] ERROR: Sleeping for 1800 seconds before trying again
But if i ssh to the server and performs a manual chef-client
, the converging completes successfully.
What might be causing this issue?
yum repolist on the node shows intermittent unavailability. Below is the the console output (i have removed other repo data it returned in the below list)
[root@c933445 test]# yum repolist
Loaded plugins: product-id, security, subscription-manager
epel/metalink | 13 kB 00:00
epel | 4.4 kB 00:00
http://mirror.sfo12.us.leaseweb.net/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
Trying other mirror.
epel | 4.4 kB 00:00
http://mirror.pnl.gov/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel
Trying other mirror.
epel | 4.4 kB 00:00
epel/primary_db | 6.4 MB 00:00
repo id repo name status
epel Extra Packages for Enterprise Linux 6 - x86_64 11,287
repolist: 41,472