Crazy-making with yum_package and package

hi. i’m having problems trying to install a package. any help?

specs: CentOS 5.8, chef-full-0.10.10-1

case node[:platform]
when “redhat”, “centos”, “scientific”, "fedora"
yum_package “zrm-innobackupex” do
version "0.81.3-1"
options "–enablerepo=epel --enablerepo=palominodb"
action :install
end
end

results in:

[Tue, 25 Sep 2012 18:26:42 +0000] INFO: Processing yum_package[zrm-innobackupex] action install (cupcake-percona::percona-setup line 75)
[Tue, 25 Sep 2012 18:26:42 +0000] DEBUG: yum_package[zrm-innobackupex] couldn’t match zrm-innobackupex in installed Provides, loading available Provides - this may take a moment
[Tue, 25 Sep 2012 18:26:46 +0000] DEBUG: yum_package[zrm-innobackupex] checking yum info for zrm-innobackupex-0.81.3-1
[Tue, 25 Sep 2012 18:26:46 +0000] DEBUG: yum_package[zrm-innobackupex] installed version: (none) candidate version: (none)
[Tue, 25 Sep 2012 18:26:46 +0000] ERROR: yum_package[zrm-innobackupex] (cupcake-percona::percona-setup line 75) has had an error
[Tue, 25 Sep 2012 18:26:46 +0000] ERROR: yum_package[zrm-innobackupex] (/var/cache/chef/cookbooks/cupcake-percona/recipes/percona-setup.rb:75:in from_file') had an error: yum_package[zrm-innobackupex] (cupcake-percona::percona-setup line 75) had an error: Chef::Exceptions::Package: Version 0.81.3-1 of zrm-innobackupex not found. Did you specify both version and release? (version-release, e.g. 1.84-10.fc6) /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/package/yum.rb:1088:ininstall_package’
/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/package.rb:59:in action_install' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource.rb:454:inrun_action’
/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:49:in run_action' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:85:inblock (2 levels) in converge’
/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:85:in each' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/runner.rb:85:inblock in converge’
/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection.rb:94:in block in execute_each_resource' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:116:in call_iterator_block' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:104:in iterate' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/resource_collection.rb:92:in `execute_each_resource’
…snip

for ‘version’ in the above resource block, i’ve also tried specifying
"0.81.3-1.noarch", but it still errors.

side question – it seems to me specifying version is required. is it?
if so, why? i would think the yum_package resource could grab the latest
available from the configured yum repos.

i have also tried substituting resource ‘package’ for ‘yum_package’, but
got similar failures.

and yet, when i do this install by hand, yum has no problem finding the
package and dependencies:

yum --enablerepo=epel --enablerepo=palominodb install zrm-innobackupex

…snip
Dependencies Resolved

================================================================================
Package Arch Version Repository Size

Installing:
zrm-innobackupex noarch 0.81.3-1 palominodb 26 k
Installing for dependencies:
MySQL-zrm noarch 2.1.1-5.el5 epel 131 k
perl-Data-Report noarch 0.10-4.el5 epel 28 k
perl-DateTime-Format-Mail noarch 0.30-4.el5 epel 179 k
perl-DateTime-Format-W3CDTF noarch 0.04-1.el5 epel 16 k
perl-Text-CSV noarch 1.10-3.el5 epel 49 k
perl-XML-RSS noarch 1.31-1.el5 epel 50 k

Transaction Summary

Install 7 Package(s)
Upgrade 0 Package(s)

Total download size: 479 k
Is this ok [y/N]:

thanks so much,
kallen

On Tue, Sep 25, 2012 at 11:42 AM, kallen@groknaut.net wrote:

hi. i'm having problems trying to install a package. any help?

specs: CentOS 5.8, chef-full-0.10.10-1

case node[:platform]
when "redhat", "centos", "scientific", "fedora"
yum_package "zrm-innobackupex" do
version "0.81.3-1"
options "--enablerepo=epel --enablerepo=palominodb"
action :install
end
end

results in:

/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/package/yum.rb:1088:in install_package' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/package.rb:59:in action_install'

Looking in here, it's appears that Chef builds a cache of what's
available. I suspect your problem is that the repos you want to
add aren't in the default list to search. I don't think the version
name is the problem at all, getting Chef to cache the right repos is
where you
should start looking.

I'm just guessing from a quick look at the code, so I could be
completely off base.

  • Booker C. Bense

thanks for the tip. it seems the problem is related to this:
http://lists.opscode.com/sympa/arc/chef/2012-08/msg00057.html

yum_package doesn't seem to honor the enablerepo options i pass it.
by default, i have disabled repos "epel" and "palominodb". e.g.

host# grep enabled /etc/yum.repos.d/epel.repo
enabled=0

passing --enablerepo=epel will enable epel in runtime. but my recipe
using yum_package fails to install the package.

my recipe succeeds installing the package if i enable those 2 repos
in /etc/yum.repos.d/ by hand.

i did try "flush_cache [ :before ]" in my recipe, no joy.

it looks like this is a bug already logged here:
http://tickets.opscode.com/browse/CHEF-2427

kallen

On Tue, 25 Sep 2012, Booker Bense wrote:

On Tue, Sep 25, 2012 at 11:42 AM, kallen@groknaut.net wrote:

hi. i'm having problems trying to install a package. any help?

specs: CentOS 5.8, chef-full-0.10.10-1

case node[:platform]
when "redhat", "centos", "scientific", "fedora"
yum_package "zrm-innobackupex" do
version "0.81.3-1"
options "--enablerepo=epel --enablerepo=palominodb"
action :install
end
end

results in:

/opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/package/yum.rb:1088:in install_package' /opt/opscode/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.10/lib/chef/provider/package.rb:59:in action_install'

Looking in here, it's appears that Chef builds a cache of what's
available. I suspect your problem is that the repos you want to
add aren't in the default list to search. I don't think the version
name is the problem at all, getting Chef to cache the right repos is
where you
should start looking.

I'm just guessing from a quick look at the code, so I could be
completely off base.

  • Booker C. Bense