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

No candidate version available for rabbitmq-server in Ubuntu 14.04 and 4.7.0 #356

Closed
iramello opened this issue Apr 3, 2016 · 6 comments

Comments

@iramello
Copy link

iramello commented Apr 3, 2016

Hi,
When installing rabbitmq-server with < 4.6.0 in Ubuntu 14.04, it works fine. However, using 4.7.0 it fails with:

Error executing action upgrade on resource 'package[rabbitmq-server]'

Chef::Exceptions::Package

No candidate version available for rabbitmq-server

Resource Declaration:

In /var/lib/aws/opsworks/cache.stage2/cookbooks/rabbitmq/recipes/default.rb

60: package 'rabbitmq-server' do
61: provider Chef::Provider::Package::Dpkg
62: source ::File.join(Chef::Config[:file_cache_path], node['rabbitmq']['deb_package'])
63: action :upgrade
64: end
65: end

Compiled Resource:

Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/rabbitmq/recipes/default.rb:60:in `from_file'

package("rabbitmq-server") do
provider Chef::Provider::Package::Dpkg
action [:upgrade]
retries 0
retry_delay 2
package_name "rabbitmq-server"
source "/var/lib/aws/opsworks/cache.stage2/rabbitmq-server_3.6.1-1_all.deb"
version "3.6.1-1"
cookbook_name "rabbitmq"
recipe_name "default"
end

The attributes are the default for this:
default['rabbitmq']['version'] = '3.6.1'
default['rabbitmq']['deb_package'] = "rabbitmq-server_#{node['rabbitmq']['version']}-1_all.deb"
default['rabbitmq']['deb_package_url'] = "https://www.rabbitmq.com/releases/rabbitmq-server/v#{node['rabbitmq']['version']}/"

The package is downloaded fine (line #56 in default.rb):
INFO: remote_file[/var/lib/aws/opsworks/cache.stage2/rabbitmq-server_3.6.1-1_all.deb] updated file contents /var/lib/aws/opsworks/cache.stage2/rabbitmq-server_3.6.1-1_all.deb
However it fails on the line mentioned above (#60).

Anyone is having the same the same issue?
Thanks.

iramello referenced this issue Apr 3, 2016
- Make the Debian installation behave more like RedHat by allowing package upgrades
@pianoman19372
Copy link

I am having the same issue when using v4.8.0 of the rabbitmq community cookbook on ubuntu (14.04)
i found that making this change in the community cookbook solved my issue:

diff --git a/cookbooks/rabbitmq/recipes/default.rb b/cookbooks/rabbitmq/recipes/default.rb
index a16d621..dbe3116 100644
--- a/cookbooks/rabbitmq/recipes/default.rb
+++ b/cookbooks/rabbitmq/recipes/default.rb
@@ -64,7 +64,7 @@ when 'debian'
     package 'rabbitmq-server' do
       provider Chef::Provider::Package::Dpkg
       source ::File.join(Chef::Config[:file_cache_path], node['rabbitmq']['deb_package'])
-      action :upgrade
+      action :install
     end
   end

I'm using v3.0.0 of the erlang cookbook, v4.8.0 of the rabbitmq cookbook, v1.9.2 of the apt cookbook.
our apt cookbook is out of date, i'll attempt to update it and see if the problem remains, I really wouldn't be surprised if this issue is really a bug in our old/outdated apt cookbook.

my test environment is chefdk 0.14.25 using test-kitchen v1.9.1 with a kitchen.yml file that uses chef-client 11.16.4 and uses the base-ubuntu-14.04-x86_64 vagrant base box.

my recipe that im testing simply includes the rabbitmq cookbook without setting any attributes, it attempts to install v 3.6.1-1 of rabbitmq-server just like what is reported on the PR.

I'll upgrade our apt cookbook to the latest version and re-read the chef docs on the dpkg provider / package resource for chef 11 to see if im missing something here..

@pianoman19372
Copy link

pianoman19372 commented Jun 8, 2016

I have some updated information on this:

the highest apt cookbook i could go to is v3.0.0 as i am running chef 11 and v4.0.0 requires chef 12

  • this did not fix the issue

after taking a closer look as to what is providing the 'provider', it looks like chef-client is

updating to the latest chef 11 client (via kitchen.yml) did not fix the issue.
updating to the latest chef 12 client (via kitchen.yml) DID fix the issue.

there must be a difference in how the dpkg provider handles 'update' in chef 11 vs chef 12.

working version of chef-client: chef stable 12.10.24 for ubuntu

@bdwyertech
Copy link
Contributor

bdwyertech commented Jun 8, 2016

The current releases of this cookbook are developed with intent for Chef 12+ only

as per @jjasghar #330

Something like this might work in a wrapper cookbook, just FYI @pianoman19372

This should override the action on the resource back to what you want.

resources('package[rabbitmq-server]').tap do |pkg|
  pkg.action :install
end

@jjasghar
Copy link
Contributor

jjasghar commented Jun 8, 2016

Yep, that is correct. Chef11 backwards compatibility opened up a huge can of worms so we stayed away from it.

You're more then welcome to fork and may the required changes, but I can't have Chef11 support upstream.

Also the original issue has "opsworks" in the error, this is a Chef cookbook, officially not an Opsworks one.

@jjasghar jjasghar closed this as completed Jun 8, 2016
@devsibwarra
Copy link
Contributor

@jjasghar Might I recommend adding chef_version ">= 12" to metadata.rb? Chef docs for it are here and may help avoid these problems in the future.

@jjasghar
Copy link
Contributor

jjasghar commented Aug 2, 2016

@devsibwarra great point, put in #391 for the release.

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

No branches or pull requests

5 participants