Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

cookbook stop working after yum upgrade #144

Open
binlialfie opened this issue May 3, 2017 · 2 comments
Open

cookbook stop working after yum upgrade #144

binlialfie opened this issue May 3, 2017 · 2 comments

Comments

@binlialfie
Copy link

in centos 7, the cookbook works fine initially, mesos-1.1.0-2.0.107.centos701406 installed

in the second chef-client, mesos-1.1.0-2.0.107.centos701406 upgrade to mesos-1.2.0-2.0.6 as expected after yum update happens somewhere.

however, the following error occurs for the next chef-client

Recipe: mesos::install
  * yum_package[unzip] action install (up to date)
  * yum_package[libcurl] action install (up to date)
  * yum_package[subversion] action install (up to date)
  * yum_package[mesos] action install

    ================================================================================
    Error executing action `install` on resource 'yum_package[mesos]'
    ================================================================================

    Chef::Exceptions::Package
    -------------------------
    Installed package mesos-1.2.0-2.0.6 is newer than candidate package mesos-1.1.0-2.0.107.centos701406

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/mesos/recipes/install.rb

     54:   yum_package 'mesos' do
     55:     version lazy {
     56:       # get the version-release string directly from the Yum provider rpmdb
     57:       Chef::Provider::Package::Yum::YumCache
     58:         .instance.instance_variable_get('@rpmdb').lookup('mesos')
     59:         .find { |pkg| pkg.version.v == node['mesos']['version'] }
     60:         .version.to_s
     61:     }
     62:   end
     63: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/mesos/recipes/install.rb:54:in `from_file'

    yum_package("mesos") do
      package_name "mesos"
      action [:install]
      default_guard_interpreter :default
      declared_type :yum_package
      cookbook_name "mesos"
      recipe_name "install"
      version "1.1.0-2.0.107.centos701406"
    end

    System Info:
    ------------
    chef_version=13.0.118
    platform=centos
    platform_version=7.3.1611
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
    program_name=chef-client worker: ppid=30621;start=14:45:03;
    executable=/opt/chef/bin/chef-client


Running handlers:
[2017-05-03T14:45:24+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-05-03T14:45:24+00:00] ERROR: Exception handlers complete
Chef Client failed. 16 resources updated in 20 seconds
[2017-05-03T14:45:24+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-05-03T14:45:24+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-05-03T14:45:24+00:00] ERROR: yum_package[mesos] (mesos::install line 54) had an error: Chef::Exceptions::Package: Installed package mesos-1.2.0-2.0.6 is newer than candidate package mesos-1.1.0-2.0.107.centos701406
[2017-05-03T14:45:24+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@binlialfie
Copy link
Author

remove the mesos-1.2.0-2.0.6 package manually, will then repeat the above behaviours all again.

@kamaradclimber
Copy link
Contributor

@binlialfie you've probably solved your issue during the last 12 months but just in case:
this is a normal behavior. You are asking chef to install mesos package to version 1.2.0-2.0.6 whereas you have a more recent version installed.

Default chef behavior in this case is to refuse to do it. You'd need the allow_downgrade property set to allow chef to downgrade the package.

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

No branches or pull requests

2 participants