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

rabbitmq doesn't support package upgrade #143

Closed
wenchma opened this issue Sep 19, 2014 · 11 comments
Closed

rabbitmq doesn't support package upgrade #143

wenchma opened this issue Sep 19, 2014 · 11 comments
Assignees

Comments

@wenchma
Copy link
Contributor

wenchma commented Sep 19, 2014

If there exists a rabbitmq package installed, and we want to upgrade it to higher version, the current recipe will do nothing.
https://github.com/kennonkwok/rabbitmq/blob/master/recipes/default.rb#L95

@martinb3
Copy link

Actually, I get an error if one is already installed now:

Recipe: rabbitmq::default
  * remote_file[/var/chef/cache/rabbitmq-server-3.1.5-1.noarch.rpm] action create_if_missing (up to date)
  * rpm_package[/var/chef/cache/rabbitmq-server-3.1.5-1.noarch.rpm] action install

    ================================================================================
    Error executing action `install` on resource 'rpm_package[/var/chef/cache/rabbitmq-server-3.1.5-1.noarch.rpm]'
    ================================================================================

    Chef::Exceptions::Exec
    ----------------------
    rpm  -U /var/chef/cache/rabbitmq-server-3.1.5-1.noarch.rpm returned 2, expected 0

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/rabbitmq/recipes/default.rb

    104:     rpm_package "#{Chef::Config[:file_cache_path]}/rabbitmq-server-#{node['rabbitmq']['version']}-1.noarch.rpm"
    105:   end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/rabbitmq/recipes/default.rb:104:in `from_file'

    rpm_package("/var/chef/cache/rabbitmq-server-3.1.5-1.noarch.rpm") do
      provider Chef::Provider::Package::Rpm
      action :install
      retries 0
      retry_delay 2
      guard_interpreter :default
      package_name "/var/chef/cache/rabbitmq-server-3.1.5-1.noarch.rpm"
      source "/var/chef/cache/rabbitmq-server-3.1.5-1.noarch.rpm"
      version "3.1.5-1"
      timeout 900
      cookbook_name "rabbitmq"
      recipe_name "default"
    end

@jayashree-nataraj
Copy link

i am trying to update from version 3.3.1 to 3.4.1, the chef run completes. logs shows that i installed 3.4.1 version, but the version still remains 3.3.1 when you check the service status.
I tried to restart manually, and it shows the new version. only works 1/3 times. i have mostly end up having database upgrade issues otherwise.

@jjasghar
Copy link
Contributor

jjasghar commented Dec 2, 2014

@JayashreeN that sounds like we're missing a :notifies or something after the update is happened. Are you installing it from the package? If so which and what distro?

@jayashree-nataraj
Copy link

i have use_distro_version set to false, and use rpm_package. I am trying to do an inplace upgrade from 3.3.1 to 3.4.1.
So on an existing cluster with 3.3.1, i am trying to upgrade it to higher version. to do this, i updated the attribute version.

reparing to replace rabbitmq-server 3.3.1-1 (using .../rabbitmq-server_3.4.1-1_all.deb) ...
Unpacking replacement rabbitmq-server ...
Setting up rabbitmq-server (3.4.1-1) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
[2014-12-02T17:05:32+00:00] DEBUG: STDERR:
[2014-12-02T17:05:32+00:00] DEBUG: ---- End output of dpkg -i /var/chef/cache/rabbitmq-server_3.4.1-1_all.deb ----
[2014-12-02T17:05:32+00:00] DEBUG: Ran dpkg -i /var/chef/cache/rabbitmq-server_3.4.1-1_all.deb returned 0
[2014-12-02T17:05:32+00:00] INFO: Processing service[rabbitmq-server] action stop (rabbitmq::default line 50)
[2014-12-02T17:05:32+00:00] DEBUG: Skipping service[rabbitmq-server] due to only_if ruby block
[2014-12-02T17:05:32+00:00] INFO: Processing execute[remove rabbitmq init.d command] action run (rabbitmq::default line 55)
[2014-12-02T17:05:32+00:00] DEBUG: Platform ubuntu version 12.04 found
[2014-12-02T17:05:32+00:00] INFO: execute[remove rabbitmq init.d command] ran successfully
[2014-12-02T17:05:32+00:00] INFO: Processing file[/etc/init.d/rabbitmq-server] action delete (rabbitmq::default line 59)
[2014-12-02T17:05:32+00:00] INFO: Processing template[/etc/init/rabbitmq-server.conf] action create (rabbitmq::default line 63)
[2014-12-02T17:05:32+00:00] DEBUG: template[/etc/init/rabbitmq-server.conf] checksumming file at /etc/init/rabbitmq-server.conf.

@jjasghar
Copy link
Contributor

jjasghar commented Dec 2, 2014

rpm_package? and it's calling dpkg -i /var/chef/cache/rabbitmq-server_3.4.1-1_all.deb ? I'll need to see if the rpm_package attriube controls the debian packages. If so, we need to change that name, that's confusing.

@jjasghar jjasghar added the TODO label Dec 2, 2014
@jayashree-nataraj
Copy link

yes and yes. Thank you!!

@jjasghar
Copy link
Contributor

jjasghar commented Dec 3, 2014

@JayashreeN i cant seems to find where you set to use rpm_package can you link me the attribute.rb line that its set in?

@jjasghar
Copy link
Contributor

jjasghar commented Dec 3, 2014

@jayashree-nataraj
Copy link

yes,
https://github.com/jjasghar/rabbitmq/blob/master/recipes/default.rb#L35-L45
that
is it.

https://github.com/jjasghar/rabbitmq/blob/master/attributes/default.rb#L2-L4
in the attribute.rb

On Wed, Dec 3, 2014 at 1:24 PM, JJ Asghar notifications@github.com wrote:

Are you specifically talking about this?
https://github.com/jjasghar/rabbitmq/blob/master/recipes/default.rb#L35-L45


Reply to this email directly or view it on GitHub
#143 (comment).

@jjasghar
Copy link
Contributor

jjasghar commented Dec 3, 2014

Ok, so i think i get where you're coming from now.

We need to add a notifies to the upgrade/install package recipe to force it every time. Would you like to put a PR and test in for this?

The rpm_package resource is only called on rpm based distros, your deb based distro should be using the correct resource provider, if not the default package resource.

@jjasghar
Copy link
Contributor

jjasghar commented Dec 9, 2014

I created #180 to resolve this, if you have other thoughts please put them there.

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

4 participants