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

Is there a way to suppress the reboot handler exception (via attribute?) #93

Closed
rayterrill opened this issue Jun 24, 2016 · 5 comments
Closed

Comments

@rayterrill
Copy link

Cookbook version

3.3.2

Chef-client version

12.11.18.1

Platform Details

Server 2012R2

Scenario:

Installing WMF5 using the PowerShell cookbook, and rebooting immediately, which throws the exception. Is there a way to disable this (via an attribute, etc)?

Steps to Reproduce:

node.set['powershell']['installation_reboot_mode'] = 'immediate_reboot'
include_recipe 'powershell::powershell5'

Expected Result:

Provide or identify a mechanism to suppress exception.

Actual Result:

RuntimeError: ruby_block[end_chef_run](powershell::windows_reboot line 16) had an error: RuntimeError: Requested sudden end to the run... I hope this was justified.
c:/chef/cache/cookbooks/powershell/recipes/windows_reboot.rb:18:in block (2 levels) in from_file' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider/ruby_block.rb:35:incall'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider/ruby_block.rb:35:in block in action_run' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/mixin/why_run.rb:52:inadd_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider.rb:176:in converge_by' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider/ruby_block.rb:34:inaction_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/provider.rb:145:in run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource.rb:591:inrun_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:69:in run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:77:inblock in run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:in each' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:inrun_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:77:in block in run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:ineach'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:75:in run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:97:inblock (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:97:in each' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:97:inblock in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in block in execute_each_resource' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:incall'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in call_iterator_block' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:instep'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:104:in iterate' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in execute_each_resource' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/runner.rb:96:inconverge'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:669:in block in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:664:incatch'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:664:in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:703:inconverge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/client.rb:283:in run' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:268:inrun_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:244:in block in run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/local_mode.rb:44:inwith_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:227:in run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:456:insleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:443:in block in interval_run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:442:inloop'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:442:in interval_run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application/client.rb:426:inrun_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/lib/chef/application.rb:59:in run' C:/opscode/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18-universal-mingw32/bin/chef-client:26:in<top (required)>'
C:/opscode/chef/bin/chef-client:62:in load' C:/opscode/chef/bin/chef-client:62:in

'

@smurawski
Copy link
Contributor

This really needs a re-write (I've got a branch in progress) and move to using the core chef reboot resource.

@rlaveycal
Copy link

An observation on this: The immediate reboot isn't working for me (Win2012R2, Chef 12.4.1 and 12.12.15). It seems the reboot_pending? guard condition is preventing the reboot handler being notified.

      notifies :request, 'windows_reboot[powershell]', :immediately if reboot_pending? && node['powershell']['installation_reboot_mode'] != 'no_reboot'

The server does reboot at the end of the run as a pending reboot is detected by the handler.

@jimmarch
Copy link

I'm guessing this is the same issue I came to report.
Trying to get powershell v5 installed to try out using dsc_resource.
The windows cookbook seems to have removed the reboot_handler recipe....

chef-boneyard/windows@98e1d2d

@smurawski
Copy link
Contributor

This should be fixed via 864f1c5 and we should get a new release of the cookbook out soon.

@smurawski
Copy link
Contributor

closed via #100

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