Error executing action `create` on resource 'ruby_block[omnibus chef killer]'


#1

Hello guys,

I am trying to run omnibus_updater to update chef-clients on nodes, but at every node on which i’m running omnibus_updater on, I’m getting the following error:

================================================================================ Error executing action ``create on resource 'ruby_block[omnibus chef killer]’
================================================================================

RuntimeError
------------
New omnibus chef version installed. Killing Chef run!

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/omnibus_updater/recipes/installer.rb:66:in `block (2 levels) in from_file'

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/omnibus_updater/recipes/installer.rb

 64:   ruby_block 'omnibus chef killer' do
 65:     block do
 66:       raise 'New omnibus chef version installed. Killing Chef run!'
 67:     end
 68:     action :nothing
 69:     only_if do
 70:       node[:omnibus_updater][:kill_chef_on_upgrade]
 71:     end
 72:   end
 73:

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/omnibus_updater/recipes/installer.rb:64:in `from_file'

ruby_block("omnibus chef killer") do
  action [:nothing]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  block_name "omnibus chef killer"
  declared_type :ruby_block
  cookbook_name "omnibus_updater"
  recipe_name "installer"
  block #<Proc:0x00000005110788@/var/chef/cache/cookbooks/omnibus_updater/recipes/installer.rb:65>
  only_if { #code block }
end


Running handlers:
[2016-07-15T08:32:18+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-07-15T08:32:18+00:00] ERROR: Exception handlers complete
Chef Client failed. 5 resources updated in 03 minutes 10 seconds
[2016-07-15T08:32:18+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-07-15T08:32:18+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-07-15T08:32:18+00:00] ERROR: ruby_block[omnibus chef killer] (omnibus_updater::installer line 64) had an error: RuntimeError: New omnibus chef version installed. Killing Chef run!
[2016-07-15T08:32:18+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)`

It’s a CentOS 6.6 machine, the cookbook version is 1.1.1 and i’m trying to update chef-client from 12.7.2 to latest 12.12.15

Thank you,
Gabriel


#2

The only solution I got so far is to run chef-client again on the affected nodes. That seems to solve the problem and after the run, chef-client is updated.

Is there another solution?
Thank you.
Gabriel


#3

This is the intended behavior as the cookbook is written currently. The cookbook needs to stop Chef Client after the upgrade to ensure that cached data such as the location of ohai plugins on disk is refreshed.

Currently the only way for a recipe to make chef exit that works for all cases is to raise a fatal error; the reboot resource has some functionality to end a Chef Client run early without a fatal error, but it won’t force Chef Client to exit in all cases, so the cookbook uses a fatal error instead.


#4

thank you.