Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chef 12.1.1 yum_package silently fails #3059

Closed
irvingpop opened this issue Mar 11, 2015 · 10 comments
Closed

Chef 12.1.1 yum_package silently fails #3059

irvingpop opened this issue Mar 11, 2015 · 10 comments
Assignees
Milestone

Comments

@irvingpop
Copy link

Doing the following on RHEL 7.1:

# chef-shell 
loading configuration: none (standalone session)
Session type: standalone
Loading..done.

This is the chef-shell.
 Chef Version: 12.1.1
 http://www.chef.io/
 http://docs.chef.io/

run `help' for help, `exit' or ^D to quit.

Ohai2u ec2-user@ip-rh-backend1.rhel.aws!
chef > recipe_mode
chef:recipe > package 'chef-server-core-12.0.5-1' do
chef:recipe > source '/var/chef/cache/chef-server-core-12.0.5-1.el6.x86_64.rpm'
chef:recipe ?> action :install
chef:recipe ?> end
=> <yum_package[chef-server-core-12.0.5-1] @name: "chef-server-core-12.0.5-1" @noop: nil @before: nil @params: {} @provider: nil @allowed_actions: [:nothing, :install, :upgrade, :remove, :purge, :reconfig] @action: [:install] @updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "(irb#1):1:in `irb_binding'" @guard_interpreter: nil @default_guard_interpreter: :default @elapsed_time: 0 @sensitive: false @candidate_version: nil @options: nil @package_name: "chef-server-core-12.0.5-1" @resource_name: :yum_package @response_file: nil @response_file_variables: {} @source: "/var/chef/cache/chef-server-core-12.0.5-1.el6.x86_64.rpm" @version: nil @timeout: 900 @flush_cache: {:before=>false, :after=>false} @allow_downgrade: false @declared_type: :package @cookbook_name: nil @recipe_name: nil> 

Worked fine previous to Chef 12.1.0. Now gets:

chef:recipe > run_chef
[2015-03-11T14:39:03-04:00] INFO: Processing yum_package[chef-server-core-12.0.5-1] action install ((irb#1) line 1)
[2015-03-11T14:39:03-04:00] DEBUG: providers for generic yum_package resource enabled on node include: [Chef::Provider::Package::Yum]
[2015-03-11T14:39:03-04:00] DEBUG: providers that refused resource yum_package[chef-server-core-12.0.5-1] were: []
[2015-03-11T14:39:03-04:00] DEBUG: providers that support resource yum_package[chef-server-core-12.0.5-1] include: [Chef::Provider::Package::Yum]
[2015-03-11T14:39:03-04:00] DEBUG: providers that survived replacement include: [Chef::Provider::Package::Yum]

... snip...

[2015-03-11T14:39:17-04:00] DEBUG: yum_package[chef-server-core-12.0.5-1] checking rpm status
chef-server-core 12.0.5-1.el6
[2015-03-11T14:39:17-04:00] DEBUG: yum_package[chef-server-core-12.0.5-1] checking yum info for chef-server-core-12.0.5-1-12.0.5-1.el6
[2015-03-11T14:39:17-04:00] DEBUG: yum_package[chef-server-core-12.0.5-1] installed version: [nil] candidate version: (none)
[2015-03-11T14:39:17-04:00] DEBUG: yum_package[chef-server-core-12.0.5-1] chef-server-core-12.0.5-1 not installed, installing 
[2015-03-11T14:39:17-04:00] DEBUG: yum_package[chef-server-core-12.0.5-1] is already installed - nothing to do


chef:recipe > `rpm -qi chef-server-core`
 => "package chef-server-core is not installed\n" 

@irvingpop
Copy link
Author

This way also fails:

package '/var/chef/cache/chef-server-core-12.0.5-1.el6.x86_64.rpm'

@bdwyertech
Copy link

👍 Seeing the same thing on CentOS 7

jaym added a commit that referenced this issue Mar 12, 2015
This fixes #3059

The package provider was expecting that candidate_versions be
populated, however in the case where a source was being provided,
it the version was being set to nil.
@btm btm added this to the 12.1.2 milestone Mar 13, 2015
@btm
Copy link
Contributor

btm commented Mar 16, 2015

Planning to patch this in 12.1.2 with #3065 and take on #3075 as tech debt for 12.2.0.

@jaym jaym closed this as completed in 99f236a Mar 16, 2015
jaym added a commit that referenced this issue Mar 16, 2015
This fixes #3059

The package provider was expecting that candidate_versions be
populated, however in the case where a source was being provided,
it the version was being set to nil.
@btm
Copy link
Contributor

btm commented Mar 23, 2015

This should be fixed in 12.1.2.

@unhuman
Copy link

unhuman commented Apr 23, 2015

This is not fixed in 12.1.2, nor is it corrected in 12.2.1. Works properly in 12.0.3. I'm on Centos 6.5.

My use case is upgrading couchbase, so I install couchbase on a VM and attempt to upgrade it using chef. I see:

[2015-04-23T12:57:41+00:00] DEBUG: yum_package[/tmp/kitchen/cache/couchbase-server-enterprise_2.5.2_x86_64.rpm] checking rpm status
couchbase-server 2.5.2-1154
[2015-04-23T12:57:41+00:00] DEBUG: yum_package[/tmp/kitchen/cache/couchbase-server-enterprise_2.5.2_x86_64.rpm] installed version: ["2.5.0-1059"] candidate version: 2.5.2-1154
[2015-04-23T12:57:41+00:00] DEBUG: yum_package[/tmp/kitchen/cache/couchbase-server-enterprise_2.5.2_x86_64.rpm] /tmp/kitchen/cache/couchbase-server-enterprise_2.5.2_x86_64.rpm 2.5.0-1059 already installed
[2015-04-23T12:57:41+00:00] DEBUG: yum_package[/tmp/kitchen/cache/couchbase-server-enterprise_2.5.2_x86_64.rpm] is already installed - nothing to do

@bdwyertech
Copy link

👍 What @unhuman said. Seems to be broken still @irvingpop

@btm
Copy link
Contributor

btm commented Apr 27, 2015

@unhuman that looks like a different bug related to upgrades. @bdwyertech are you also upgrading an existing package?

Original bug:

[2015-03-11T14:39:17-04:00] DEBUG: yum_package[chef-server-core-12.0.5-1] installed version: [nil] candidate version: (none)

Your output:

[2015-04-23T12:57:41+00:00] DEBUG: yum_package[/tmp/kitchen/cache/couchbase-server-enterprise_2.5.2_x86_64.rpm] installed version: ["2.5.0-1059"] candidate version: 2.5.2-1154

@bdwyertech
Copy link

@btm, In my case, yes, it would be an upgrade. Deployment works fine the first time around, but the new RPM is not installed on a successive Chef run, although the local file exists. Code looks something like this.

# => Download NXLog RPM
remote_file File.join(Chef::Config[:file_cache_path], File.basename(node['nxlog']['url'])) do
  source node['nxlog']['url']
  checksum node['nxlog']['checksum']
  action :create
  notifies :install, 'package[nxlog]', :immediately
end

# => Install NXLog from RPM
package 'nxlog' do
  source File.join(Chef::Config[:file_cache_path], File.basename(node['nxlog']['url']))
  action :nothing
end

@unhuman
Copy link

unhuman commented Apr 27, 2015

Since it's a different bug, do I need to start a new thread to get the issue I'm seeing managed?

Thanks for following up!

@btm
Copy link
Contributor

btm commented Apr 27, 2015

@unhuman I've created #3292. Let's talk about it there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants