chef-boneyard / push-jobs-cookbook

Development repository for Chef Cookbook push-jobs
https://supermarket.chef.io/cookbooks/push-jobs
Apache License 2.0
21 stars 43 forks source link

Can't upgrade push-client #119

Closed nmattam closed 6 years ago

nmattam commented 7 years ago

Cookbook version

4.0.2

Chef-client version

12.17.44

Platform Details

RHEL66 and RHEL65

Scenario:

Trying to upgrade from ops-push-jobs-client 1.1.5 to chef-push-jobs-client 2.2.0

Steps to Reproduce:

This can be reproduced by upgrading the version of push jobs client on the node from 1.1.5 to 2.2.0

Expected Result:

chef-client fails with this error

==> rhel66: ruby_block[stop chef run] action nothing ==> rhel66: (skipped due to action :nothing) ==> rhel66:
==> rhel66:
rpm_package[push-client] action install ==> rhel66:
==> rhel66: ==> rhel66:
==> rhel66: ================================================================================ ==> rhel66:
==> rhel66: Error executing action install on resource 'rpm_package[push-client]' ==> rhel66:
==> rhel66: ================================================================================ ==> rhel66:
==> rhel66: ==> rhel66: ==> rhel66:
==> rhel66: Mixlib::ShellOut::ShellCommandFailed ==> rhel66: ------------------------------------ ==> rhel66: Expected process to exit with [0], but received '1' ==> rhel66: ---- Begin output of ["rpm", "-i", "/var/chef/cache/push-jobs-client-2.2.0-1.el6.x86_64.rpm"] ---- ==> rhel66: STDOUT: ==> rhel66: STDERR: warning: /var/chef/cache/push-jobs-client-2.2.0-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY ==> rhel66: error: Failed dependencies: ==> rhel66: opscode-push-jobs-client conflicts with push-jobs-client-2.2.0-1.el6.x86_64 ==> rhel66: ---- End output of ["rpm", "-i", "/var/chef/cache/push-jobs-client-2.2.0-1.el6.x86_64.rpm"] ---- ==> rhel66: Ran ["rpm", "-i", "/var/chef/cache/push-jobs-client-2.2.0-1.el6.x86_64.rpm"] returned 1 ==> rhel66:

==> rhel66: error: Failed dependencies: ==> rhel66: opscode-push-jobs-client conflicts with push-jobs-client-2.2.0-1.el6.x86_64

Actual Result:

Push jobs successfully upgraded to 2.2.0

cheeseplus commented 7 years ago

Reading through the code, this uses chef_ingredient as the mechanism to install thing and the default action is :install which is fundamentally different than :upgrade which is what you actually want here. As written, the cookbook is throwing this error as expected.

As for working around it, in theory if we added the ability to pass :upgrade as an action to chef_ingredient this would be resolveable or having your own wrapper call chef_ingredient with either a remove, then install or just an upgrade.

nmattam commented 7 years ago

Thanks @cheeseplus for looking into it. As you suggested I got around this by uninstalling the old push jobs client usingchef_ingredient in my wrapper and then calling the default recipe to install the new one.