# Recipe throws an error at reboot

**URL:** <https://discourse.chef.io/t/recipe-throws-an-error-at-reboot/12773>\
**Category:** Chef Infra (archive)\
**Created:** [March 15, 2018, 4:37pm UTC](https://discourse.chef.io/t/recipe-throws-an-error-at-reboot/12773 "2018-03-15T16:37:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marathiboy](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Marathiboy](https://discourse.chef.io/u/Marathiboy)\
**Post date:** [March 15, 2018, 4:37pm UTC](https://discourse.chef.io/t/recipe-throws-an-error-at-reboot/12773/1 "2018-03-15T16:37:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joris](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joris/32/2193_2.png) [@joris](https://discourse.chef.io/u/joris)\
**Post date:** [March 15, 2018, 5:16pm UTC](https://discourse.chef.io/t/recipe-throws-an-error-at-reboot/12773/2 "2018-03-15T17:16:16Z")

</div>

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.

> <https://github.com/chef/chef/blob/master/lib/chef/application/exit_code.rb#L34>

---

<div class="post-metadata">

**Author:** ![Marathiboy](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@Marathiboy](https://discourse.chef.io/u/Marathiboy)\
**Post date:** [March 15, 2018, 5:21pm UTC](https://discourse.chef.io/t/recipe-throws-an-error-at-reboot/12773/3 "2018-03-15T17:21:26Z")

</div>

Got it thanks

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

Thanks

M

---

<div class="post-metadata">

**Author:** ![spuder](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/spuder/32/1382_2.png) [@spuder](https://discourse.chef.io/u/spuder)\
**Post date:** [March 19, 2018, 2:39am UTC](https://discourse.chef.io/t/recipe-throws-an-error-at-reboot/12773/4 "2018-03-19T02:39:31Z")

</div>

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).

> <https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md>
