Recipe throws an error at reboot


#1

Hello,

I have a reboot block called from a ruby block

ruby_block “xxx” do
block

end…
notifies :reboot_now, ‘reboot[reboot_me]’, :immediate
end

reboot ‘reboot_me’ do
action :nothing
end

It does work and however I get following error

  ERROR: Running exception handlers
  Running handlers complete
  ERROR: Exception handlers complete
  Chef Client failed. 5 resources updated xxxxxx
  FATAL: Stacktrace dumped xxxxxxx
  FATAL: Please provide xxxxx
  ERROR: Rebooting server at a recipe's request: {:delay_mins=>0; xxxxx}
  FATAL: Chef::Exception::ChildConvergeError: Chef run process exited unsuccessfully (exit code 35)

I have tried to delay the reboot used delay_mins etc but I still get similar error, nothing interesting in stacktrace, what I may be doing wrong?

M


#2

I think it’s working as expected.

Basically, you want your node to reboot so chef doesn’t exit successfully because you have yet to reboot.


#3

Got it thanks

It makes sense now, but looking at the error, it looked dumb:-(

Thanks

M


#4

In chef 12, a reboot would return exit code 0
In chef 13, a reboot returns exit code 35

More details are in this RFC

The intent of this switch is so that at a future date, external tools will be able to detect if chef rebooted a vm and intelligently resume a chef-client run. Presently you need to leave behind some mechanism to run chef after the reboot (windows scheduled task, linux cron job).