Giter Club home page Giter Club logo

chef_client_updater's People

Contributors

akitada avatar bdwyertech avatar bkonick avatar brandonthemandon avatar btm avatar cmrcode avatar decoyjoe avatar detjensrobert avatar dheerajd-msys avatar jasonwbarnett avatar jeremymv2 avatar jjustice6 avatar jwdean avatar lamont-granquist avatar markgibbons avatar nashwini avatar nimesh-msys avatar rabidpitbull avatar ramereth avatar rhass avatar robbertjansw avatar scotthain avatar smurawski avatar spion06 avatar stefanwb avatar tas50 avatar tyler-ball avatar wjordan avatar xorimabot avatar yurylevin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chef_client_updater's Issues

Infinite loop on current channel

With only:

chef_client_updater 'current' do
  channel 'current'
end

chef will get endlessly re-execed, since we don't check that what we're running is the latest, but simply blindly install.

Ignore chef.io backend problems

Cookbook version

3.1.2

Chef-client version

12.21.26

Platform Details

Ubuntu 16.04.3

Scenario:

When the chef.io infrastructure experiences problems as it has a few times in the past week, the chef_client_updater resource fails the entire Chef run due to an inability to connect to the backend. It would be useful to have an option to ignore this specific type of connection failure as one hopes it's just a transient problem and isn't something directly fixable by Chef users anyways.

I was hoping there was a way to use edit_resource with ignore_failure to do what I was looking for here, but the exception seems to be from Ruby code, not a resource (though I would be happy to be told otherwise).

Steps to Reproduce:

Include this cookbook's default recipe in a run list and... well, wait for packages.chef.io to go down, then do a Chef run.

Expected Result:

Not so much expectation as a request - log a connection warning but don't treat it as a failing condition.

Actual Result:

Run fails with this error

[2018-01-16T00:50:26+00:00] INFO: Processing chef_client_updater[update chef-client] action update (chef_client_updater::default line 20)
[2018-01-16T00:50:27+00:00] WARN: NO /opt/chef.upgrade DIR TO ROLL BACK TO!
...
[2018-01-16T00:50:28+00:00] ERROR: chef_client_updater[update chef-client] (chef_client_updater::default line 20) had an error: Net::HTTPFatalError: 503 "Backend is unhealthy"
[2018-01-16T00:50:28+00:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

and top lines of the stacktrace:

>>>> Caused by Net::HTTPFatalError: 503 "Backend is unhealthy"
/opt/chef/embedded/lib/ruby/2.3.0/net/http/response.rb:120:in `error!'
/opt/chef/embedded/lib/ruby/2.3.0/net/http/response.rb:129:in `value'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.8.0/lib/mixlib/install/backend/package_router.rb:156:in `get'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.8.0/lib/mixlib/install/backend/package_router.rb:125:in `artifacts_for_version'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.8.0/lib/mixlib/install/backend/package_router.rb:43:in `available_artifacts'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.8.0/lib/mixlib/install/backend/base.rb:62:in `info'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.8.0/lib/mixlib/install/backend.rb:29:in `info'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.8.0/lib/mixlib/install.rb:46:in `artifact_info'
/var/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb:99:in `configure_from_channel'
/var/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb:49:in `configure_package'
/var/chef/cache/cookbooks/chef-ingredient/libraries/default_handler.rb:23:in `handle_install'
/var/chef/cache/cookbooks/chef-ingredient/resources/chef_ingredient.rb:59:in `block in class_from_file'

Invalid checksum causes chef-client to indefinitely fail

Cookbook version

3.1.3

Chef-client version

12.21.31

Platform Details

RHEL 6.9

Scenario:

Setting a download URL with an incorrect checksum causes the update to fail, but still allows the /opt/chef folder to be moved.

Steps to Reproduce:

  • Set a newer version to update to
  • Set a download URL
  • Set an incorrect checksum
  • Run chef-client

Expected Result:

I would expect the chef-client update to fail due to an incorrect checksum before changing the state of the node.

Actual Result:

The chef-client run fails during the upgrade; however, still allows the /opt/chef folder to be moved. Thus, any subsequent attempts to run chef-client fail without reverting the folder change. Moreover, the error output is not helpful and does not indicate the issue was an invalid checksum.

Stacktrace:

Recipe: chef_client_updater::default
  * chef_client_updater[update chef-client] action update
    - upgrade rubygems 2.6.10 to latest
    * chef_gem[mixlib-install] action install
      - install version ~> 3.5 of package mixlib-install
    - move all files under /opt/chef to /opt/chef.upgrade
    - upgrade chef-client 12.19.36 to 12.21.31
    ================================================================================
    Error executing action `update` on resource 'chef_client_updater[update chef-client]'
    ================================================================================

    SystemExit
    ----------
    exit

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:176:in `exit'
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:176:in `run_post_install_action'
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:331:in `block (2 levels) in class_from_file'
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:330:in `block in class_from_file'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

     20: chef_client_updater 'update chef-client' do
     21:   channel node['chef_client_updater']['channel']
     22:   version node['chef_client_updater']['version']
     23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
     24:   post_install_action node['chef_client_updater']['post_install_action']
     25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override']
     26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
     27: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

    chef_client_updater("update chef-client") do
      action [:update]
      updated true
      updated_by_last_action true
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "chef_client_updater"
      recipe_name "default"
      channel "stable"
      version "12.21.31"
      prevent_downgrade true
      post_install_action "kill"
      download_url_override "https://myinternalmirror.com/yum/chef-12.21.31-1.el6.x86_64.rpm"
      checksum "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
      exec_command "chef-client"
      exec_args []
    end

    Platform:
    ---------
    x86_64-linux

Chef hangs on client downgrade

Cookbook version

1.0.2

Chef-client version

12.19.36

Platform Details

Windows 2012 R2

Scenario:

Trying to downgrade to 12.5.1

Steps to Reproduce:

On a chef node running 12.19.36 use the chef_client_updater resource with the prevent_downgrade false option to downgrade to 12.5.1

Expected Result:

12.19.36 is replaced by 12.5.1 on converge

Actual Result:

Chef gets stuck waiting for the previous version of chef to stop. Output:
10.211.192.112 [2017-04-26T10:37:42+01:00] INFO: Processing chef_client_updater_updater[Install 12.5.1] action update (cloudhouse_chef_node::default line 7) 10.211.192.112 [2017-04-26T10:37:42+01:00] WARN: Replacing ourselves with the new version of Chef to continue the run. 10.211.192.112 [2017-04-26T10:37:45+01:00] WARN: Chef client 2440 is running, will wait for it to finish and then run.

Readme: the windows service code snippet is strange

In section "Running Chef Client As A Windows Service", the README shows this snippet:

if Chef::VERSION < node['my_update_cookbook']['desired_version']
  run_chef_task_in_ten_minutes = Time.now + 600

  windows_task 'chef-client-upgrade' do
    cwd 'C:\\opscode\\chef\\bin'
    command 'chef-client'
    run_level :highest
    frequency :once
    start_time "#{run_chef_task_in_ten_minutes.strftime('%H:%M')}"
    action :create
  end
else
  windows_task 'chef-client-upgrade' do
    cwd 'C:\\opscode\\chef\\bin'
    command 'chef-client'
    run_level :highest
    frequency :once
    start_time "#{run_chef_task_in_ten_minutes.strftime('%H:%M')}"
    action :delete
  end
end

What should it do? The if and else branches are perfectly identical, with the only difference that in the else branch, the variable run_chef_task_in_ten_minutes is nil, so that run_chef_task_in_ten_minutes.strftime is guaranteed to raise a NoMethodError.

What am I missing?

error undefined method 'version' for #<Array:0x0000000b9db290>

Cookbook version

2.0.3

Chef-client version

13.1.31

Platform Details

Windows Server 2012R2 running on AWS Cloud

Scenario:

normal chef-client run

Steps to Reproduce:

run chef-client with chef_client_updater in runlist

Expected Result:

Chef to finish convergence

Actual Result:

error on several but not all of my windows servers.

Recipe: chef_client_updater::default
  * chef_client_updater[update chef-client] action update[2017-06-28T10:00:52-05:00] WARN: NO c:/opscode/chef.upgrade DI
R TO ROLL BACK TO!


    ================================================================================
    Error executing action `update` on resource 'chef_client_updater[update chef-client]'
    ================================================================================

    NoMethodError
    -------------
    undefined method `version' for #<Array:0x0000000b9db290>

    Resource Declaration:
    ---------------------
    # In C:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

     20: chef_client_updater 'update chef-client' do
     21:   channel node['chef_client_updater']['channel']
     22:   version node['chef_client_updater']['version']
     23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
     24:   post_install_action node['chef_client_updater']['post_install_action']
     25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['do
wnload_url_override']
     26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
     27: end

    Compiled Resource:
    ------------------
    # Declared in C:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

    chef_client_updater("update chef-client") do
      action [:update]
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "chef_client_updater"
      recipe_name "default"
      channel "stable"
      version "latest"
      prevent_downgrade true
      post_install_action "exec"
    end

    System Info:
    ------------
    chef_version=13.1.31
    platform=windows
    platform_version=6.3.9600
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x64-mingw32]
    program_name=C:/opscode/chef/bin/chef-client
    executable=C:/opscode/chef/bin/chef-client


Running handlers:
[2017-06-28T10:00:52-05:00] ERROR: Running exception handlers
Running handlers complete
[2017-06-28T10:00:52-05:00] ERROR: Exception handlers complete
Chef Client failed. 1 resources updated in 35 seconds
[2017-06-28T10:00:52-05:00] FATAL: Stacktrace dumped to C:/chef/cache/chef-stacktrace.out
[2017-06-28T10:00:52-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-06-28T10:00:52-05:00] FATAL: NoMethodError: chef_client_updater[update chef-client] (chef_client_updater::default
line 20) had an error: NoMethodError: undefined method `version' for #<Array:0x0000000b9db290>

chef-stacktrace.out:

Generated at 2017-06-28 10:00:52 -0500
NoMethodError: chef_client_updater[update chef-client] (chef_client_updater::default line 20) had an error: NoMethodError: undefined method `version' for #<Array:0x0000000b9db290>
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:112:in `update_necessary?'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:228:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/provider.rb:211:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/provider.rb:211:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/provider.rb:171:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource.rb:591:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:70:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:98:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:98:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:98:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:97:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:273:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:249:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:232:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:58:in `load'
C:/opscode/chef/bin/chef-client:58:in `<main>'

>>>> Caused by NoMethodError: undefined method `version' for #<Array:0x0000000b9db290>
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:112:in `update_necessary?'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:228:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/provider.rb:211:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/provider.rb:211:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/provider.rb:171:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource.rb:591:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:70:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:98:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:98:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:98:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/runner.rb:97:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:273:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:249:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:232:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.1.31-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:58:in `load'
C:/opscode/chef/bin/chef-client:58:in `<main>'

Allow floating versions

Cookbook version

:latest

Chef-client version

12.19.36

Platform Details

N/A

Scenario:

Allow version specification such as "<13.0.0", or "~>12.19" etc.

Expected Result:

Available versions should be match using the known ruby version rules, and the latest version that matches installed.

chef_client_updater fails after chef-client been upgrade

Cookbook version

3.2.5

Chef-client version

[Version of chef-client in your environment]

Platform Details

Centos 7

Scenario:

Upgrading Chef-client from 12.20.3 to latest (13.8.5)

Steps to Reproduce:

We are calling this cookbook a role to update chef client
run_list "recipe[xxxx]", "recipe[chef_client_updater::default]"
Chef run and update the chef-client but it gives an error at the end which shows that the jobs has failed.
==> default: [2018-03-14T15:57:11+00:00] WARN: Chef client is running forked with a supervisor. Sending TERM to parent process! ==> default: [2018-03-14T15:57:11+00:00] WARN: New chef-client installed and exit is allowed. Forcing chef exit! ==> default: ==> default: ================================================================================ ==> default: Error executing action updateon resource 'chef_client_updater[update chef-client]' ==> default: ================================================================================ ==> default: ==> default: SystemExit ==> default: ---------- ==> default: exit ==> default: ==> default: Cookbook Trace: ==> default: --------------- ==> default: /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:180:inexit'
==> default: /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:180:in run_post_install_action' ==> default: /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:343:in block (2 levels) in class_from_file'
==> default: /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:342:in block in class_from_file' ==> default: ==> default: Resource Declaration: ==> default: --------------------- ==> default: # In /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb ==> default: ==> default: 20: chef_client_updater 'update chef-client' do ==> default: 21: channel node['chef_client_updater']['channel'] ==> default: 22: version node['chef_client_updater']['version'] ==> default: 23: prevent_downgrade node['chef_client_updater']['prevent_downgrade'] ==> default: 24: post_install_action node['chef_client_updater']['post_install_action'] ==> default: 25: download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override'] ==> default: 26: checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum'] ==> default: 27: upgrade_delay node['chef_client_updater']['upgrade_delay'] unless node['chef_client_updater']['upgrade_delay'].nil? ==> default: 28: product_name node['chef_client_updater']['product_name'] if node['chef_client_updater']['product_name'] ==> default: 29: end ==> default: ==> default: Compiled Resource: ==> default: ------------------ ==> default: # Declared in /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in from_file'
==> default:
==> default: chef_client_updater("update chef-client") do
==> default: action [:update]
==> default: updated true
==> default: updated_by_last_action true
==> default: retries 0
==> default: retry_delay 2
==> default: default_guard_interpreter :default
==> default: declared_type :chef_client_updater
==> default: cookbook_name "chef_client_updater"
==> default: recipe_name "default"
==> default: channel "stable"
==> default: version "latest"
==> default: prevent_downgrade false
==> default: post_install_action "kill"
==> default: product_name "chef"
==> default: exec_command "chef-solo"
==> default: exec_args ["--config", "/tmp/vagrant-chef/solo.rb", "--json-attributes", "/tmp/vagrant-chef/dna.json", "--log_level", "info", "--force-formatter"]
==> default: end
==> default:
==> default: Platform:
==> default: ---------
==> default: x86_64-linux
==> default:
==> default: [2018-03-14T15:57:11+00:00] INFO: Running queued delayed notifications before re-raising exception
==> default:
==> default: Running handlers:
==> default: [2018-03-14T15:57:11+00:00] ERROR: Running exception handlers
==> default: Running handlers complete
==> default: [2018-03-14T15:57:11+00:00] ERROR: Exception handlers complete
==> default: Chef Client failed. 33 resources updated in 07 minutes 50 seconds
==> default: [2018-03-14T15:57:11+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2018-03-14T15:57:11+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
==> default: [2018-03-14T15:57:11+00:00] ERROR: chef_client_updater[update chef-client] (chef_client_updater::default line 20) had an error: SystemExit: exit
==> default: bash: line 4: 19898 Killed chef-solo --config /tmp/vagrant-chef/solo.rb --json-attributes /tmp/vagrant-chef/dna.json --log_level info --force-formatter
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.`

Expected Result:

We accept that chef would exit with success status not an error.

When I commented run-post-install. Chef process exit without any error.

chef.upgrade folder not deleted on w2k12r2 and w2k16 after upgrade

Cookbook version

3.0.4

Chef-client version

13.5.3

Platform Details

w2k12r2 or w2k16

Scenario:

This cookbook keeps trying to delete the chef.upgrade folder in C:\opscode after a successful upgrade. It does not error out, but it fails to remove the chef.upgrade folder.

Steps to Reproduce:

  1. Upgrade from Chef Client 12.19.36 to 13.5.3 using this cookbook (3.0.4) on w2k12r2.
chef_client_updater 'Enforce_chef_client_version' do
  version '13.5.3'
  post_install_action 'kill'
end
  1. Run chef-client again. Subsequent runs will fail to remove the chef.upgrade folder.

Expected Result:

  • Cookbook should be idempotent.
  • Cookbook should delete chef.upgrade folder after upgrade is completed.
  • Cookbook should error if it fails to delete chef.upgrade folder.

Actual Result:

  • Cookbook is not idempotent after upgrade.
  • Cookbook does not delete chef.upgrade folder after upgrade is completed.
  • Cookbook does not error when it fails to delete chef.upgrade folder.

Debug Output For Runs After Upgrade

  * chef_client_updater[Enforce_chef_client_version] action update[2017-10-25T14:42:51-06:00] INFO: Processing chef_clie
nt_updater[Enforce_chef_client_version] action update (test_cookbook::default line 13)
[2017-10-25T14:42:51-06:00] DEBUG: Providers for generic chef_client_updater resource enabled on node include: [LWRP pro
vider chef_client_updater from cookbook chef_client_updater]
[2017-10-25T14:42:51-06:00] DEBUG: Provider for action update on resource chef_client_updater[Enforce_chef_client_versio
n] is LWRP provider chef_client_updater from cookbook chef_client_updater

    - remove c:/opscode/chef.upgrade from previous chef-client run2.6.13
[2017-10-25T14:42:52-06:00] DEBUG: Found gem version 2.6.13. Desired version is at least 2.6.11
[2017-10-25T14:42:53-06:00] DEBUG: Platform detected as {:platform=>"windows", :platform_version=>"2012r2", :architectur
e=>"x86_64"} by mixlib_install
[2017-10-25T14:42:53-06:00] DEBUG: Passing options to mixlib-install: {:product_name=>"chef", :platform_version_compatib
ility_mode=>true, :platform=>"windows", :platform_version=>"2012r2", :architecture=>"x86_64", :channel=>:stable, :produc
t_version=>"13.5.3"}
[2017-10-25T14:42:53-06:00] DEBUG: Desired version in specified channel maps to 13.5.3
[2017-10-25T14:42:53-06:00] DEBUG: The current chef-client version is 13.5.3 and the desired version is 13.5.3

When running chef-client as service, service dies after upgrade

Cookbook version

1.0.2

Chef-client version

upgrade 12.10.24 to 12.19.36

Platform Details

Ubuntu 16.04 using the chef-client cookbook 7.2.1

Scenario:

Upgrade without the parent process dying in a forked chef run

Steps to Reproduce:

use the chef-client cookbook to define a chef-client service that runs chef-client as a daemon (chef-client::service).
set `node['chef_client_updater']['version'] to a higher version to trigger upgrade
Send SIGUSR1 to chef-client daemon process to trigger run

Expected Result:

Upgrade client without daemon process dying

Actual Result:

chef-client will be upgraded, and the daemon process will die. Chef client service on all nodes will stop running and needs to be manually restarted.

HTTP Proxy overridden in Windows update

Cookbook version

2.0.2

Chef-client version

12.13.37

Platform Details

Windows 2012R2

Scenario:

We have a corporate web proxy. The http_proxy environment variable is set. When Chef is run it fails.

Steps to Reproduce:

  1. Install Chef 12.13
  2. Run Chef against chef_client_updater::default

Expected Result:

The Chef run to complete without error, updating the client if appropriate

Actual Result:

      STDOUT: There was an error:
        Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
        Unable to connect to the remote server
        No connection could be made because the target machine actively refused it 151.101.16.65:443
      STDERR: C:\Users\vagrant\AppData\Local\Temp\chef-script20170627-3988-zi9j61.ps1 : Failed to download from
      https://omnitruck.chef.io/stable/chef/metadata?v=12.21.1&p=windows&pv=2012r2&m=x86_64.
          + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,chef-script20170627-3988-zi9j61.ps1

Diagnostics

Hunting around in the code leads me to believe the problem is in mixlib-install-3.3.0\lib\mixlib\install\generator\powershell\scripts\install_project.ps1 which contains the line

  # Set http_proxy as env var
  $env:http_proxy = $http_proxy

to override the environment proxy with the value of the script's local parameter. The problem is that this parameter is derived from the options hash used to instantiate the Mixlib::Install object which doesn't set it. Without a String::IsNullOrEmpty() check the effect is to disable the proxy setting

Adding a couple of write-hosts above this line shows this:

env:http_proxy = http://proxy1.uk.webscanningservice.com:3128
http_proxy =

I'd love to do a PR but I'm slammed with other stuff.

Recent change fails on Windows instances due to unguarded cron

Cookbook version

3.2.8

Chef-client version

12.22.1

Platform Details

Windows Server (2008R2, 2012R2)

Scenario:

Run chef-client

Steps to Reproduce:

Run chef-client on windows with the cookbook in the runlist

Expected Result:

Chef run to finish

Actual Result:

Chef run fails due to not having cron:

Recipe: chef_client_updater::default
  * cron[chef_client_updater] action delete

    ================================================================================
    Error executing action `delete` on resource 'cron[chef_client_updater]'
    ================================================================================

    Errno::ENOENT
    -------------
    No such file or directory - crontab -l -u root

    Resource Declaration:
    ---------------------
    # In C:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

     21: cron 'chef_client_updater' do
     22:   action :delete
     23: end
     24:

    Compiled Resource:
    ------------------
    # Declared in C:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:21:in `from_file'

    cron("chef_client_updater") do
      action [:delete]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      minute "*"
      hour "*"
      day "*"
      month "*"
      weekday "*"
      user "root"
      declared_type :cron
      cookbook_name "chef_client_updater"
      recipe_name "default"
    end

    System Info:
    ------------
    chef_version=12.22.1
    platform=windows
    platform_version=6.1.7601
    ruby=ruby 2.3.6p384 (2017-12-14 revision 61254) [x64-mingw32]
    program_name=C:/opscode/chef/bin/chef-client
    executable=C:/opscode/chef/bin/chef-client


Running handlers:
Running handlers complete
Chef Client failed. 4 resources updated in 12 seconds

The change was added recently

unnecessary rubygems upgrades to latest version

Scenario:

Using this cookbook with any Chef Client packaged with Rubygems < 2.6.11 (which looks to be Chef Client < 12.21.4) will unnecessarily upgrade Rubygems to the latest un-pinned version.

(In my specific use-case, the recent release of Rubygems 2.7.5 containing an update to Bundler 1.16.1 caused a previously-working test-build process to fail due to an unrelated issue with the different Bundler version.)

Steps to Reproduce:

Run a default converge (e.g., the default suite in the test-kitchen config) using a chef-client version < 12.21.4, with a target version (e.g., chef_client_updater.version attribute in the test cookbook) set to the same version.

Expected Result:

  • Rubygems shouldn't be upgraded unless the version currently installed is old (specifically, if the rubygems version is so old that it won't install mixlib-install from gems, as noted in #19)
  • When necessary, Rubygems should only be upgraded to a fixed version (so the cookbook behavior is deterministic)

Actual Result:

$ OMNIBUS_CHEF_VERSION=12.17.44 KITCHEN_YAML=./.kitchen.dokken.yml bundle exec kitchen verify default
[...]
Recipe: test::default
  * chef_client_updater[Install Chef 12.17.44] action update
    - upgrade rubygems 2.6.8 to latest
[...]
$ KITCHEN_YAML=./.kitchen.dokken.yml bundle exec kitchen login default
root@01234567890:/# /opt/chef/embedded/bin/gem -v
2.7.5
  • Rubygems is upgraded even when the current version will certainly install mixlib-install from gems properly, and will work fine with this cookbook without upgrading
  • Rubygems is automatically upgraded to the latest publicly-available version (currently 2.7.5). When a new version of rubygems is released, chef_client_updater will automatically upgrade the embedded rubygems to it on the next converge. Not only does this make this cookbook behavior non-deterministic, it's dangerous since new Rubygems releases may contain bugs or (if the upgrade is a major-version increase) intentional API-breaking changes that cause Chef to fail.

Error executing action 'update' on resource 'chef_client_updater[Install 14.0.190 and kill]'

Cookbook version

3.3.0

Chef-client version

12.8.1

Platform Details

Windows Server 2012 R2 Datacenter - Azure

Scenario:

Trying to upgrade to Chef 14 by putting the chef_client_updater resource in a cookbook at the beginning of my run-list

Steps to Reproduce:

Before you fixed the last bug, I was including the chef_client_updater recipe, but after the bug fix with 3.3.0, I went back to using just the resource and tried again to run it to no avail. I also tried to manually run chef_upgrade.ps1, and it didn't run.

Expected Result:

I'm expecting chef_client_updater resource to execute.

Actual Result:

Error executing action 'update' on resource 'chef_client_updater[Install 14.0.190 and kill]'

#<SystemExit: chef_client_updater[Install 14.0.190 and kill] (relone_operations::setup line 7) had an error: SystemExit: exit> had an error:

chef_client_updater[Install 14.0.190 and kill] (relone_operations::setup line 7) had an error: SystemExit: exit

Description: Error executing action update on resource 'chef_client_updater[Install 14.0.190 and kill]'

SystemExit

exit

Cookbook Trace:

c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:180:in `exit'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:180:in `run_post_install_action'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:348:in `block (2 levels) in class_from_file'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:347:in `block in class_from_file'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

Resource Declaration:

# In c:/chef/cache/cookbooks/relone_operations/recipes/setup.rb

  7: chef_client_updater "Install #{desired_chef_version} and kill" do
  8:   version desired_chef_version
  9:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
 10: end
 11: 

Compiled Resource:

# Declared in c:/chef/cache/cookbooks/relone_operations/recipes/setup.rb:7:in `from_file'

chef_client_updater("Install 14.0.190 and kill") do
  action [:update]
  updated true
  updated_by_last_action true
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  declared_type :chef_client_updater
  cookbook_name "relone_operations"
  recipe_name "setup"
  version "14.0.190"
  prevent_downgrade true
  product_name "chef"
  post_install_action "kill"
end

Stacktrace

c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:180:in `exit'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:180:in `run_post_install_action'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:348:in `block (2 levels) in class_from_file'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/provider.rb:175:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:347:in `block in class_from_file'
(eval):2:in `block in action_update'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/provider.rb:360:in `instance_eval'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/provider.rb:360:in `compile_and_converge_action'
(eval):2:in `action_update'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/provider.rb:144:in `run_action'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource.rb:596:in `run_action'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/resource_list.rb:84:in `block in execute_each_resource'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/resource_list.rb:82:in `execute_each_resource'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:668:in `block in converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:663:in `catch'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:663:in `converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:702:in `converge_and_save'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:280:in `run'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:252:in `run_with_graceful_exit_option'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:228:in `block in run_chef_client'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:211:in `run_chef_client'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application/client.rb:417:in `run_application'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:58:in `run'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/bin/chef-client:26:in `<top (required)>'
c:/opscode/push-jobs-client/bin/chef-client:63:in `load'
c:/opscode/push-jobs-client/bin/chef-client:63:in `<main>'

Windows - Chef_upgrade task fails when Powershell ExecutionPolicy is set to Restricted

Cookbook version

3.1.0

Chef-client version

13.5.3 (to upgrade to 13.6.4)

Platform Details

Windows 2012 R2

Scenario:

Upgrade of Chef Client fails when Powershell Execution Policy is set to Restricted

Steps to Reproduce:

powershell Set-ExecutionPolicy Restricted
Upgrade Chef Client using this cookbook

Expected Result:

I am expecting the Chef_upgrade task to upgrade the Chef Client

Actual Result:

Chef_upgrade task will fail to run and will retry every minute
If you run powershell Set-ExecutionPolicy RemoteSigned, the task will succeed in the next run

Need an option to disable SHA256 hash check

Cookbook version

2.0.1

Chef-client version

12.17.44 to 12.20.3

Platform Details

Windows Server 2012 R2 - AWS

Scenario:

Attempting in upgrade Chef-client on a Windows Server 2012 R2.

Steps to Reproduce:

Our systems are hardened per DISA Stigs. Which is preventing the SHA256 hash check call in the install powershell script.

You can replicate the issue by setting the below registry key to 1. If set to 0 the powershell SHA256 check will work.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\fipsalgorithmpolicy
Enabled = 1

Calling the resource like this:

chef_client_updater 'update chef-client' do
  prevent_downgrade true
  version '12.20.3'
  download_url_override 'https://s3.amazonaws.com/somebucket/chef-client-12.20.3-1-x64.msi'
end

Expected Result:

Successful run with the checlient being upgraded to 12.20.3.

Actual Result:

---- Begin output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/user/AppData/Local/Temp/chef-script20170616-6856-h6zzx.ps1" ----
STDOUT: 
STDERR: C:\Users\user\AppData\Local\Temp\chef-script20170616-6856-h6zzx.ps1 : Exception calling "Create" with "1" argument(s): "This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms."    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,chef-script20170616-6856-h6zzx.ps1
---- End output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/user/AppData/Local/Temp/chef-script20170616-6856-h6zzx.ps1" ----
Ran "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/sysdrl1/AppData/Local/Temp/chef-script20170616-6856-h6zzx.ps1" returned 1

Workaround

For a temporary workaround I am using this:

registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\fipsalgorithmpolicy' do
  values [{ name: 'Enabled', type: :dword, data: '0' }]
  action :create
end

chef-client runs and exits successfully but the process hangs around afterwards

Cookbook version

chef_client_updater 1.0.2

Chef-client version

chef-client 12.17.44

Platform Details

CentOS 6.9

Scenario:

chef-client runs and exits successfully but the process hangs around afterwards, this doesn't stop chef-client from running again but it does trigger alerts on our side for the lingering process.

Steps to Reproduce:

It only happens on a small section of our nodes, I have no idea how to reproduce. I have an inkling that due to upgrading chef-client the old pid gets left and doesn't get overwritten with the new version chef-client pid.

Expected Result:

chef-client doesn't show up with ps -ef

Actual Result:

chef-client is show in ps -ef

chef-client run doesn't finish

Cookbook version

2.0.2

Chef-client version

Was 12.15.19 Installed 13.1.31

Platform Details

Windows 2012 R2 Azure Build

Scenario:

Upgrade the chef-client on windows

Steps to Reproduce:

Starting Chef Client, version 12.15.19
resolving cookbooks for run list: ["chef_client_updater"]
Synchronizing Cookbooks:
  - chef_client_updater (2.0.2)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: chef_client_updater::default
  * chef_client_updater[update chef-client] action update
    - upgrading rubygems to 2.6.11 was 2.6.7
    * chef_gem[mixlib-install] action install
      - install version >= 3.2.1 of package mixlib-install
    - moving all files under c:/opscode/chef to c:/opscode/chef.upgrade
    * powershell_script[name] action run
      - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -Executio
nPolicy Bypass -InputFormat None -File "C:/Users/recovery/AppData/Local/Temp/2/chef-script20170627-4028-f3w3zi.ps1"
[2017-06-27T15:28:13+00:00] WARN: Replacing ourselves with the new version of Chef to continue the run.
[2017-06-27T15:28:19+00:00] WARN: Chef client 4028 is running, will wait for it to finish and then run.
[2017-06-27T15:28:19+00:00] WARN: Chef client 4028 is running, will wait for it to finish and then run.

Expected Result:

chef-client run to end or restart

Actual Result:

From what I can tell looking around the system, the old client was move to the .upgrade folder, the new version msi was downloaded and installed (add remove programs lists version 13.1.31 as installed. but the chef-client run (process 4028) doesn't ever finish? there is nothing more in the log so I don't know where else to look to find out why the process has hung

After an hour I killed the process (4028) and the chef-client immeditaly kicked off another run using 13.1.31 removed the .upgrade folder

As a side there was still one file left

C:\opscode\chef.upgrade\embedded\lib\ruby\gems\2.3.0\gems\chef-12.15.19-universal-mingw32\ext\win32-eventlog\chef-log.dll

preventing it from removing fully

Update failure due to mixlib missing options

Cookbook version

3.0.2

Chef-client version

12.20.3

Platform Details

Windows Server 2012 R2

Scenario:

Use chef_client_updater cookbook in wrapper cookbook to upgrade from v12.20.3 to v13

Steps to Reproduce:

Create wrapper cookbook, include in a production node's default.rb, run chef-client --once

Expected Result:

A full chef run, followed by an upgrade of Chef Client completing successfully

Actual Result:

It appears that it is failing because mixlib is unable to detect the platform details, despite it being configured in the providers on line 76-82. I'm not sure of the root cause. The full chef-client output along with the stacktrace are below.

Recipe: ttd-chef_client_updater::default
  * chef_client_updater[Install latest Chef 13.x] action update[2017-08-08T22:39:23+00:00] INFO: Processing chef_client_updater[Install latest Chef 13.x] action update (ttd-chef_client_updater::default line 1)

    - upgrade rubygems 2.6.10 to 2.6.11[2017-08-08T22:40:03+00:00] INFO: mixlib-install gem not found. Installing now

    * chef_gem[mixlib-install] action install[2017-08-08T22:40:03+00:00] INFO: Processing chef_gem[mixlib-install] action install (c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb line 32)
WARN: Unresolved specs during Gem::Specification.reset:
      aws-sigv4 (~> 1.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
[2017-08-08T22:40:49+00:00] INFO: chef_gem[mixlib-install] installed mixlib-install at >= 3.3.1

      - install version >= 3.3.1 of package mixlib-install
[2017-08-08T22:40:49+00:00] WARN: NO c:/opscode/chef.upgrade DIR TO ROLL BACK TO!

    ================================================================================
    Error executing action update on resource 'chef_client_updater[Install latest Chef 13.x]'
    ================================================================================

    Mixlib::Install::Options::InvalidOptions
    ----------------------------------------
    Must provide platform, platform version and architecture when specifying any platform details

    Cookbook Trace:
    ---------------
    c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:89:in new'
    c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:89:in mixlib_install'
    c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:115:in update_necessary?'
    c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:232:in block in class_from_file'

    Resource Declaration:
    ---------------------
    # In c:/chef/cache/cookbooks/ttd-chef_client_updater/recipes/default.rb

      1: chef_client_updater 'Install latest Chef 13.x' do
      2:   version '13'
      3: end

    Compiled Resource:
    ------------------
    # Declared in c:/chef/cache/cookbooks/ttd-chef_client_updater/recipes/default.rb:1:in from_file'

    chef_client_updater("Install latest Chef 13.x") do
      action [:update]
      updated true
      updated_by_last_action true
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "ttd-chef_client_updater"
      recipe_name "default"
      version "13"
      post_install_action "kill"
      exec_command "C:/opscode/chef/bin/chef-client"
      exec_args ["--once"]
    end

    Platform:
    ---------
    x64-mingw32

Generated at 2017-08-08 22:40:50 +0000
Mixlib::Install::Options::InvalidOptions: chef_client_updater[Install latest Chef 13.x] (ttd-chef_client_updater::default line 1) had an error: Mixlib::Install::Options::InvalidOptions: Must provide platform, platform version and architecture when specifying any platform details

C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install/options.rb:102:in `validate_options!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install/options.rb:91:in `validate!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install/options.rb:81:in `initialize'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install.rb:35:in `new'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install.rb:35:in `initialize'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:89:in `new'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:89:in `mixlib_install'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:115:in `update_necessary?'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:232:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:427:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by Mixlib::Install::Options::InvalidOptions: Must provide platform, platform version and architecture when specifying any platform details

C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install/options.rb:102:in `validate_options!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install/options.rb:91:in `validate!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install/options.rb:81:in `initialize'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install.rb:35:in `new'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-install-3.3.3/lib/mixlib/install.rb:35:in `initialize'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:89:in `new'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:89:in `mixlib_install'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:115:in `update_necessary?'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:232:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:427:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

Fails on Chef 13

Running chef_client_updater with the chef 13.0 release candidate results in:

================================================================================
    Error executing action `update` on resource 'chef_client_updater_updater[current]'
    ================================================================================

    Chef::Exceptions::ResourceNotFound
    ----------------------------------
    exec was called, but you probably meant to use an execute resource.  If not, please call Kernel#exec explicitly.  The exec block called was "chef-client"

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:125:in `run_post_install_action'
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:36:in `block (2 levels) in class_from_file'
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:33:in `block in class_from_file'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/base/recipes/default.rb

      7: chef_client_updater 'current' do
      8:   channel 'current'
      9: end
     10:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/base/recipes/default.rb:7:in `from_file'

    chef_client_updater_updater("current") do
      action [:update]
      updated true
      updated_by_last_action true
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "base"
      recipe_name "default"
      channel "current"
    end

    System Info:
    ------------
    chef_version=13.0.113
    platform=ubuntu
    platform_version=16.04
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
    program_name=chef-client worker: ppid=4349;start=14:33:43;
    executable=/opt/chef/bin/chef-client

Platform `centos` not found (Mixlib::Install::Backend::ArtifactsNotFound)

Cookbook version

2.0.1

Chef-client version

13.1.31

Platform Details

Centos 6.5

Scenario:

Update chef-client (or downgrade chef-client); neither work.

Steps to Reproduce:

Add chef_client_updater::default to Policyfile run_list; run chef update, chef push staging, chef-client will fail on node with Mixlib::Install::Backend::ArtifactsNotFound error.

Expected Result:

chef-client should upgrade/downgrade as indicated in the cookbook.

Actual Result:

Fails with Mixlib::Install::Backend::ArtifactsNotFound error. It appears to be related to the platform being called centos instead of el. When I load the mixlib/install gem in an irb session and search for chef packages, it properly returns an array of packages, but they use el as platform instead of centos or rhel. Should the cookbook convert the platform to a standardized string (ref. to line 76 of chef_client_updater/providers/default.rb)?

Trace below:

Recipe: chef_client_updater::default
  * chef_client_updater[update chef-client] action update[2017-06-17T11:31:42-05:00] WARN: NO /opt/chef.upgrade DIR TO ROLL BACK TO!

    
    ================================================================================
    Error executing action `update` on resource 'chef_client_updater[update chef-client]'
    ================================================================================
    
    Mixlib::Install::Backend::ArtifactsNotFound
    -------------------------------------------
    No artifacts found matching criteria.
      product name: chef
      channel: stable
      version: 12.19.36
      platform: centos
      platform version: 6.5
      architecture: x86_64
      compatibility mode: true
    
    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:106:in `update_necessary?'
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:221:in `block in class_from_file'
    
    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb
    
     20: chef_client_updater 'update chef-client' do
     21:   channel node['chef_client_updater']['channel']
     22:   version node['chef_client_updater']['version']
     23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
     24:   post_install_action node['chef_client_updater']['post_install_action']
     25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override']
     26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
     27: end
    
    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'
    
    chef_client_updater("update chef-client") do
      action [:update]
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "chef_client_updater"
      recipe_name "default"
      channel "stable"
      version "12.19.36"
      prevent_downgrade false
      post_install_action "exec"
    end
    
    System Info:
    ------------
    chef_version=13.1.31
    platform=centos
    platform_version=6.5
    ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
    program_name=chef-client worker: ppid=775247;start=11:31:16;
    executable=/opt/chef/bin/chef-client
    

Running handlers:
[2017-06-17T11:31:42-05:00] ERROR: Running exception handlers
Running handlers complete
[2017-06-17T11:31:42-05:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 25 seconds
[2017-06-17T11:31:43-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-06-17T11:31:43-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-06-17T11:31:43-05:00] ERROR: chef_client_updater[update chef-client] (chef_client_updater::default line 20) had an error: Mixlib::Install::Backend::ArtifactsNotFound: No artifacts found matching criteria.
  product name: chef
  channel: stable
  version: 12.19.36
  platform: centos
  platform version: 6.5
  architecture: x86_64
  compatibility mode: true

[2017-06-17T11:31:43-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Exception handling for rm_rf /opt/chef

The unix side of this cookbook should probably mv the old /opt/chef to another directory as well.

This will be complicated by the fact that sometimes /opt/chef is a mountpoint and will piss off mv so it may need to be copied-then-deleted.

Then there most likely needs to be a rescue block at the end of the action which handles moving the old /opt/chef (or /opscode/chef) back into place.

The issue here is that if a site loses internet, then DNS lookups and everything else will fail, and then all the sites chef installs will be wiped.

(And we can't escape the fact that we must do this for Windows)

Upgrading chef-client on windows.

Note: This issue seems to be partially resolved by smurawski/windows branch #18 so I'm not sure if this is the right place for it.

Cookbook version

1.1.1

Chef-client version

12.18.31

Platform Details

Windows 2012 R2 from AWS

Scenario:

Upgrade from 12.18.31 to 13.1.31

Steps to Reproduce:

Made a test cookbook that wraps chef_client_updater::default and kitchen.yml that install 12.18.31 with require_chef_omnibus: 12.18.31.

node.default['chef_client_updater']['version'] = '13.1.31'
node.default['chef_client_updater']['post_install_action'] = 'kill'
include_recipe 'chef_client_updater::default'

Expected Result:

Chef 13.1.31 is installed and old process is killed.

       Recipe: chef_client_updater::default
         * chef_client_updater[update chef-client] action update
           - upgrading rubygems to 2.6.11 was 2.6.8
           * chef_gem[mixlib-install] action install
             - install version >= 3.2.1 of package mixlib-install
           - moving all files under c:/opscode/chef to c:/opscode/chef.upgrade
           * powershell_script[name] action run
             - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -E
xecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/chef-script20170609-2540-84jxa5.ps1"

       [2017-06-09T13:42:09+00:00] WARN: New chef-client installed. Forcing chef exit!

Actual Result:

Setting ['chef_client_updater']['post_install_action'] = 'kill' causes a Argument Error: Invalid Memory object with The system cannot find the path specified. this looks similar to issue #2/#5, but I'm not sure if it is the same thing.

-----> Converging <default-ec2-workstation-windows-2012r2>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 5.6.4...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Installing Chef Omnibus (12.18.31)
       Downloading package from https://packages.chef.io/files/stable/chef/12.18.31/windows/2012r2/chef-client-12.18.31-
1-x64.msi
       Download complete.
       Successfully verified C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-12.18.31-1-x64.msi
       Installing Chef Omnibus package C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-12.18.31-1-x64.msi
       Installation complete
       Transferring files to <default-ec2-workstation-windows-2012r2>
       Starting Chef Client, version 12.18.31
       Creating a new client identity for default-ec2-workstation-windows-2012r2 using the validator key.
       resolving cookbooks for run list: ["updatetest::default"]
       Synchronizing Cookbooks:
         - chef_client_updater (1.1.1)
         - updatetest (0.1.0)
       Installing Cookbook Gems:
       Compiling Cookbooks...
       Converging 1 resources
       Recipe: chef_client_updater::default
         * chef_client_updater[update chef-client] action update
           - upgrading rubygems to 2.6.11 was 2.6.8
           * chef_gem[mixlib-install] action install
             - install version >= 3.2.1 of package mixlib-install
           - moving all files under c:/opscode/chef to c:/opscode/chef.upgrade[2017-06-09T14:07:19+00:00] WARN: Chef cli
ent is defined for forked runs. Sending TERM to parent process!

           ================================================================================
           Error executing action `update` on resource 'chef_client_updater[update chef-client]'
           ================================================================================

           ArgumentError
           -------------
           Invalid Memory object

           Resource Declaration:
           ---------------------
           # In C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb

            20: chef_client_updater 'update chef-client' do
            21:   channel node['chef_client_updater']['channel']
            22:   version node['chef_client_updater']['version']
            23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
            24:   post_install_action node['chef_client_updater']['post_install_action']
            25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_update
r']['download_url_override']
            26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
            27: end

           Compiled Resource:
           ------------------
           # Declared in C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/defaul
t.rb:20:in `from_file'

           chef_client_updater("update chef-client") do
             action [:update]
             updated true
             updated_by_last_action true
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :chef_client_updater
             cookbook_name "chef_client_updater"
             recipe_name "default"
             channel "stable"
             version "13.1.31"
             prevent_downgrade true
             post_install_action "kill"
           end

           Platform:
           ---------
           x64-mingw32


       Running handlers:
       [2017-06-09T14:07:19+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2017-06-09T14:07:19+00:00] ERROR: Exception handlers complete
       Chef Client failed. 1 resources updated in 49 seconds
       [2017-06-09T14:07:19+00:00] FATAL: Stacktrace dumped to C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/chef-s
tacktrace.out
       [2017-06-09T14:07:19+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug repor
t
       [2017-06-09T14:07:20+00:00] FATAL: ArgumentError: chef_client_updater[update chef-client] (chef_client_updater::d
efault line 20) had an error: ArgumentError: Invalid Memory object
$$$$$$ The system cannot find the path specified.

It doesn't look like the new version of chef was installed. Here is the C:\opscode folder on the instance.

PS C:\opscode> ls


    Directory: C:\opscode


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          6/9/2017   2:06 PM            chef.upgrade


PS C:\opscode> .\chef.upgrade\bin\chef-client --version
Chef: 12.18.31
PS C:\opscode>

Setting ['chef_client_updater']['post_install_action'] = 'exec' causes a No such file or directory - C:/opscode/chef/bin/chef-client error again with The system cannot find the path specified..

-----> Converging <default-ec2-workstation-windows-2012r2>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 5.6.4...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Installing Chef Omnibus (12.18.31)
       Downloading package from https://packages.chef.io/files/stable/chef/12.18.31/windows/2012r2/chef-client-12.18.31-
1-x64.msi
       Download complete.
       Successfully verified C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-12.18.31-1-x64.msi
       Installing Chef Omnibus package C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-12.18.31-1-x64.msi
       Installation complete
       Transferring files to <default-ec2-workstation-windows-2012r2>
       Starting Chef Client, version 12.18.31
       Creating a new client identity for default-ec2-workstation-windows-2012r2 using the validator key.
       resolving cookbooks for run list: ["updatetest::default"]
       Synchronizing Cookbooks:
         - chef_client_updater (1.1.1)
         - updatetest (0.1.0)
       Installing Cookbook Gems:
       Compiling Cookbooks...
       Converging 1 resources
       Recipe: chef_client_updater::default
         * chef_client_updater[update chef-client] action update
           - upgrading rubygems to 2.6.11 was 2.6.8
           * chef_gem[mixlib-install] action install
             - install version >= 3.2.1 of package mixlib-install
           - moving all files under c:/opscode/chef to c:/opscode/chef.upgrade[2017-06-09T14:19:48+00:00] WARN: Replacin
g ourselves with the new version of Chef to continue the run.

           ================================================================================
           Error executing action `update` on resource 'chef_client_updater[update chef-client]'
           ================================================================================

           Errno::ENOENT
           -------------
           No such file or directory - C:/opscode/chef/bin/chef-client

           Resource Declaration:
           ---------------------
           # In C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb

            20: chef_client_updater 'update chef-client' do
            21:   channel node['chef_client_updater']['channel']
            22:   version node['chef_client_updater']['version']
            23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
            24:   post_install_action node['chef_client_updater']['post_install_action']
            25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_update
r']['download_url_override']
            26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
            27: end

           Compiled Resource:
           ------------------
           # Declared in C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/defaul
t.rb:20:in `from_file'

           chef_client_updater("update chef-client") do
             action [:update]
             updated true
             updated_by_last_action true
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :chef_client_updater
             cookbook_name "chef_client_updater"
             recipe_name "default"
             channel "stable"
             version "13.1.31"
             prevent_downgrade true
             post_install_action "exec"
             exec_command "C:/opscode/chef/bin/chef-client"
             exec_args ["--local-mode", "--config", "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\kitchen\\client.rb", "--
log_level", "auto", "--force-formatter", "--no-color", "--json-attributes", "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\
kitchen\\dna.json", "--chef-zero-port", "8889"]
           end

           Platform:
           ---------
           x64-mingw32


       Running handlers:
       [2017-06-09T14:19:48+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2017-06-09T14:19:48+00:00] ERROR: Exception handlers complete
       Chef Client failed. 1 resources updated in 49 seconds
       [2017-06-09T14:19:48+00:00] FATAL: Stacktrace dumped to C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/chef-s
tacktrace.out
       [2017-06-09T14:19:48+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug repor
t
       [2017-06-09T14:19:48+00:00] FATAL: Errno::ENOENT: chef_client_updater[update chef-client] (chef_client_updater::d
efault line 20) had an error: Errno::ENOENT: No such file or directory - C:/opscode/chef/bin/chef-client
$$$$$$ The system cannot find the path specified.

Again Chef 13.1.31 is not installed.

PS C:\opscode> ls


    Directory: C:\opscode


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          6/9/2017   2:27 PM            chef.upgrade


PS C:\opscode> .\chef.upgrade\bin\chef-client --version
Chef: 12.18.31
PS C:\opscode>

The smurawski/windows branch #18 also hangs when ['chef_client_updater']['post_install_action'] = 'exec' and the old chef process has to be stopped manually.

       [2017-06-09T15:01:32+00:00] WARN: Replacing ourselves with the new version of Chef to continue the run.
       [2017-06-09T15:01:37+00:00] WARN: Chef client 2896 is running, will wait for it to finish and then run.

Let me know if you need the stacktrace or anything else.
Thank you for the help.
Jonny

chef_client_updater always schedules update when product_name chefdk

Cookbook version

3.2.4

Chef-client version

13.6.4, 13.4.19

Platform Details

Windows 10, Windows 2012r2

Scenario:

Upgrade chefdk to latest, or specific version.

Steps to Reproduce:

  1. Create role with recipe[chef_client_updater] and add override attr below, run chef-client with role against node.
    {
    "chef_client_updater": {
    "product_name": "chefdk",
    "upgrade_delay": 71
    }
    }
    or for a chefdk version:
    {
    "chef_client_updater": {
    "version": "2.4.17"
    "product_name": "chefdk",
    "upgrade_delay": 71
    }
    }

Expected Result:

Install latest chefdk. On subsequent runs only install if there is new version.
or
With version specified, Install versioned chefdk, and install only when a different version was detected.

Actual Result:

Every run tries to install chefdk, scheduling a windows task Chef_upgrade that fails.
Every subsequent run on the node with this role will fail.

chef_client_updater appears to fail with errors when killing chef-client after an upgrade

When the chef_client_updater cookbook runs, it looks like an error happened, but an error didn't happen. I suggest there be a "upgrading" exit status for the chef-client so it doesn't report as an alarming event.

[2017-07-14T16:39:02-05:00] WARN: New chef-client installed. Forcing chef exit!

      ================================================================================
      Error executing action `update` on resource 'chef_client_updater[update chef-client]'
      ================================================================================

      SystemExit
      ----------
      exit

      Cookbook Trace:
      ---------------
      D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:157:in `exit'
      D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:157:in `run_post_install_action'
      D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:240:in `block (2 levels) in class_from_file'
      D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:233:in `block in class_from_file'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels
) in converge'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in conver
ge'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels
) in converge'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in conver
ge'
      D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

      Resource Declaration:
      ---------------------
      # In D:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

       20: chef_client_updater 'update chef-client' do
       21:   channel node['chef_client_updater']['channel']
       22:   version node['chef_client_updater']['version']
       23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
       24:   post_install_action node['chef_client_updater']['post_install_action']
       25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['
download_url_override']
       26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
       27: end

      Compiled Resource:
      ------------------
      # Declared in D:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

      chef_client_updater("update chef-client") do
        action [:update]
        updated true
        updated_by_last_action true
        retries 0
        retry_delay 2
        default_guard_interpreter :default
        declared_type :chef_client_updater
        cookbook_name "chef_client_updater"
        recipe_name "default"
        channel "stable"
        version "12.21.3"
        prevent_downgrade true
        post_install_action "kill"
        download_url_override "https://artifactory.hospitality.ncr.com:443/artifactory/list/platform/chef-client/chef-cl
ient-12.21.3-1-x64.msi"
        checksum "9120c1502772594f705001844f065d9fa487646b0f86df8df3647db941e48c08"
      end

      Platform:
      ---------
      x64-mingw32


    ================================================================================
    Error executing action `upgrade` on resource 'platform_client_up_to_date[client_up_to_date]'
    ================================================================================

    SystemExit
    ----------
    chef_client_updater[update chef-client] (chef_client_updater::default line 20) had an error: SystemExit: exit

    Cookbook Trace:
    ---------------
    D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:157:in `exit'
    D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:157:in `run_post_install_action'
    D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:240:in `block (2 levels) in class_from_file'
    D:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:233:in `block in class_from_file'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels)
in converge'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge
'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels)
in converge'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge
'
    D:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

    Resource Declaration:
    ---------------------
    # In D:/chef/cache/cookbooks/platform/recipes/chef_client.rb

      7: platform_client_up_to_date 'client_up_to_date'

    Compiled Resource:
    ------------------
    # Declared in D:/chef/cache/cookbooks/platform/recipes/chef_client.rb:7:in `from_file'

    platform_client_up_to_date("client_up_to_date") do
      action [:upgrade]
      updated true
      updated_by_last_action true
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :platform_client_up_to_date
      cookbook_name "platform"
      recipe_name "chef_client"
    end

    Platform:
    ---------
    x64-mingw32


Running handlers:
[2017-07-14T16:39:03-05:00] ERROR: Running exception handlers
Running handlers complete
[2017-07-14T16:39:03-05:00] ERROR: Exception handlers complete
Chef Client failed. 8 resources updated in 04 minutes 47 seconds
[2017-07-14T16:39:03-05:00] FATAL: Stacktrace dumped to D:/chef/cache/chef-stacktrace.out
[2017-07-14T16:39:03-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report

Floating pins like "12" cause infinite loop

per @mitom in #7

"Currently you can specify a version like '12' which will try to install the latest of version 12 the way the omnibus installer works. This will either send chef into a loop where it will keep triggering a new chef client run, which will trigger another update that triggers another chef client run and so on if the post action is exec, or it will keep killing the chef run every single time if it's set to kill as it seems unable to detect that it's on the right version already."

Mixlib not compatible with Chef 12.4.3?

Cookbook version

1.0.2

Chef-client version

Multiple; 12.4+ (up to latest: 13.0.118)

Platform Details

Ubuntu 12.04 x64; Running on VMware.

Scenario:

Force a downgrade from Chef 12.16.42 to 12.4.3 and then upgrade to any higher version to test upgrade and downgrade capabilities. Downgrade works just fine, but upgrade exits with Mixlib::ShellOut::ShellCommandFailed error.

Steps to Reproduce:

Take a Ubuntu 12.04 x64 VM on VMware and run the chef_client_updater cookbook to downgrade it to chef 12.4.3. Then attempt to upgrade to a newer version (like 12.5.1 or 12.16.42 or 13.0.118). The same Mixlib::ShellOut::ShellCommandFailed error appears in all of those.

Expected Result:

Since the cookbook claims compatibility with Chef 12.1+, the cookbook should successfully kill the chef run and upgrade the instance so that the next chef run is the upgraded version.

Actual Result:

Output from the Chef run:

Recipe: chef_client_updater::default
  * chef_client_updater_updater[update chef-client] action update
    * chef_gem[mixlib-install] action install

      ================================================================================
      Error executing action `install` on resource 'chef_gem[mixlib-install]'
      ================================================================================

      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '1'
      ---- Begin output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" ----
      STDOUT:
      STDERR: ERROR:  While executing gem ... (TypeError)
          no implicit conversion of nil into String
      ---- End output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" ----
      Ran /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" returned 1

      Cookbook Trace:
      ---------------
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb:106:in `build'
      /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:45:in `rescue in load_mixlib_install'
      /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:42:in `load_mixlib_install'
      /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:64:in `mixlib_install'
      /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:33:in `block (2 levels) in class_from_file'
      /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:32:in `block in class_from_file'
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:132:in `instance_eval'
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:132:in `compile_and_converge_action'
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
      /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

      Resource Declaration:
      ---------------------
      # In /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb

       45:     chef_gem 'mixlib-install' do
       46:       compile_time true if respond_to?(:compile_time)
       47:     end
       48:

      Compiled Resource:
      ------------------
      # Declared in /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:45:in `rescue in load_mixlib_install'

      chef_gem("mixlib-install") do
        action [:install]
        retries 0
        retry_delay 2
        default_guard_interpreter :default
        package_name "mixlib-install"
        version "3.2.0"
        compile_time true
        gem_binary "/opt/chef/embedded/bin/gem"
        declared_type :chef_gem
        cookbook_name "chef_client_updater"
      end


    ================================================================================
    Error executing action `update` on resource 'chef_client_updater_updater[update chef-client]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    chef_gem[mixlib-install] (/var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb line 45) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
    ---- Begin output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" ----
    STDOUT:
    STDERR: ERROR:  While executing gem ... (TypeError)
        no implicit conversion of nil into String
    ---- End output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" ----
    Ran /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" returned 1

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb:106:in `build'
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:45:in `rescue in load_mixlib_install'
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:42:in `load_mixlib_install'
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:64:in `mixlib_install'
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:33:in `block (2 levels) in class_from_file'
    /var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:32:in `block in class_from_file'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:132:in `instance_eval'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb:132:in `compile_and_converge_action'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

     20: chef_client_updater 'update chef-client' do
     21:   channel node['chef_client_updater']['channel']
     22:   version node['chef_client_updater']['version']
     23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
     24:   post_install_action node['chef_client_updater']['post_install_action']
     25: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

    chef_client_updater_updater("update chef-client") do
      action [:update]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "chef_client_updater"
      recipe_name "default"
      channel "stable"
      version "12.5.1"
      post_install_action "kill"
    end


Running handlers:
[2017-04-26T08:49:02-04:00] ERROR: Running exception handlers
Running handlers complete
[2017-04-26T08:49:02-04:00] ERROR: Exception handlers complete
Chef Client failed. 1 resources updated in 3.68236509 seconds
[2017-04-26T08:49:03-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-04-26T08:49:03-04:00] ERROR: chef_client_updater_updater[update chef-client] (chef_client_updater::default line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: chef_gem[mixlib-install] (/var/chef/cache/cookbooks/chef_client_updater/resources/updater.rb line 45) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" ----
STDOUT:
STDERR: ERROR:  While executing gem ... (TypeError)
    no implicit conversion of nil into String
---- End output of /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" ----
Ran /opt/chef/embedded/bin/gem install mixlib-install -q --no-rdoc --no-ri -v "3.2.0" returned 1
[2017-04-26T08:49:03-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

If checksum is not correct, chef-client will loop infinitely.

Cookbook version

chef_client_updater 1.1.1

Chef-client version

chef-12.19.33-1.el6.x86_64

Platform Details

CentOS 6.8

Scenario: [What you are trying to achieve and you can't?]

Upgrade chef from 12.19.33 to 12.20.3 using download_url_override.

Steps to Reproduce: [If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]

set chef_client_updater attributes as below(checksum is not correct).
"chef_client_updater": { "version": "12.20.3", "download_url_override": "http://artifactory-instance:8000/artifactory/chef_rpms/rhel/6/x86_64/release/Packages/chef-12.20.3-1.el6.x86_64.rpm", "checksum": "0000000000000000000000000000000000000000000000000000000000000000" }

Expected Result: [What are you expecting to happen as the consequence of above reproduction steps?]

If checksum is not correct, chef-client is failed and stopped.

Actual Result: [What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]

If checksum is not correct, chef-client is loop infinitely.
please see the attached file.

Upgrading chef-client on windows "Invalid Memory object"

Cookbook version

1.0.2

Chef-client version

12.19.36

Platform Details

Server 2012 R2 (vSphere 6.5)

Scenario:

Trying to update the Chef client and I always get the error "Invalid Memory object"

Steps to Reproduce:

I created my own cookbook that includes: "include_recipe 'chef_client_updater::default'"

Expected Result:

I'm expecting it to upgrade the Chef client to the latest stable version (13.0.118)

Actual Result:

PS C:\Users\Administrator> chef-client
Starting Chef Client, version 12.19.36
[2017-04-13T12:24:05-04:00] INFO: *** Chef 12.19.36 ***
[2017-04-13T12:24:05-04:00] INFO: Platform: x64-mingw32
[2017-04-13T12:24:05-04:00] INFO: Chef-client pid: 3744
[2017-04-13T12:24:09-04:00] INFO: Run List is [recipe[update_chef_client]]
[2017-04-13T12:24:09-04:00] INFO: Run List expands to [update_chef_client]
[2017-04-13T12:24:09-04:00] INFO: Starting Chef Run for caradmin100
[2017-04-13T12:24:09-04:00] INFO: Running start handlers
[2017-04-13T12:24:09-04:00] INFO: Start handlers complete.
[2017-04-13T12:24:10-04:00] INFO: HTTP Request Returned 404 Not Found:
[2017-04-13T12:24:10-04:00] INFO: HTTP Request Returned 404 Not Found:
[2017-04-13T12:24:10-04:00] INFO: Error while reporting run start to Data Collector. URL: https://carchef01.edificeprod.local/organizations/spsanalytics/data-collector Exception: 404 -- 404 "Not Found
"  (This is normal if you do not have Chef Automate)
resolving cookbooks for run list: ["update_chef_client"]
[2017-04-13T12:24:10-04:00] INFO: Loading cookbooks [[email protected], [email protected], [email protected]]
Synchronizing Cookbooks:
  - chef_client_updater (1.0.2)
  - compat_resource (12.16.3)
  - update_chef_client (0.2.6)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: chef_client_updater::default
  * chef_client_updater_updater[update chef-client] action update[2017-04-13T12:24:10-04:00] INFO: Processing chef_client_updater_updater[update chef-client] action update (chef_client_updater::defaul
t line 20)
[2017-04-13T12:24:11-04:00] WARN: Chef client is defined for forked runs. Sending TERM to parent process!


    ================================================================================
    Error executing action `update` on resource 'chef_client_updater_updater[update chef-client]'
    ================================================================================

    ArgumentError
    -------------
    Invalid Memory object

    Cookbook Trace:
    ---------------
    c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:128:in `run_post_install_action'
    c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:35:in `block (2 levels) in class_from_file'
    c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:32:in `block in class_from_file'

    Resource Declaration:
    ---------------------
    # In c:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

     20: chef_client_updater 'update chef-client' do
     21:   channel node['chef_client_updater']['channel']
     22:   version node['chef_client_updater']['version']
     23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
     24:   post_install_action node['chef_client_updater']['post_install_action']
     25: end

    Compiled Resource:
    ------------------
    # Declared in c:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

    chef_client_updater_updater("update chef-client") do
      action [:update]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "chef_client_updater"
      recipe_name "default"
      channel "stable"
      version "latest"
      prevent_downgrade true
      post_install_action "kill"
      exec_command "C:/opscode/chef/bin/chef-client"
      exec_args []
    end

    Platform:
    ---------
    x64-mingw32

[2017-04-13T12:24:11-04:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2017-04-13T12:24:11-04:00] ERROR: Running exception handlers
Running handlers complete
[2017-04-13T12:24:11-04:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 06 seconds
[2017-04-13T12:24:11-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
[2017-04-13T12:24:11-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-04-13T12:24:11-04:00] FATAL: ArgumentError: chef_client_updater_updater[update chef-client] (chef_client_updater::default line 20) had an error: ArgumentError: Invalid Memory object
PS C:\Users\Administrator>

Here is my stack trace:

Generated at 2017-04-13 12:24:27 -0400
ArgumentError: chef_client_updater_updater[update chef-client] (chef_client_updater::default line 20) had an error: ArgumentError: Invalid Memory object
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:863:in `=='
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:863:in `block in kill'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:797:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:797:in `kill'
c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:128:in `run_post_install_action'
c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:35:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:32:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by ArgumentError: Invalid Memory object
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:863:in `=='
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:863:in `block in kill'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:797:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/win32-process-0.8.3/lib/win32/process.rb:797:in `kill'
c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:128:in `run_post_install_action'
c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:35:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/resources/updater.rb:32:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

Update failure due to mixlib missing options - again

Cookbook version

3.0.3

Chef-client version

12.16.42

Platform Details

Windows Server 2008 R2

Scenario:

Trying to upgrade a Windows node but still getting the mixlib missing options error. I am using the 3.0.3 version of the chef_client_updater as recommended.

Steps to Reproduce:

Created a wrapper cookbook and assigned it to the the node.

Expected Result:

I expected my Windows node to be upgraded to the specified version of chef client.

Actual Result:

I get the following error:
[2017-08-11T14:33:50-04:00] INFO: mixlib-install gem not found. Installing now
[2017-08-11T14:33:50-04:00] INFO: Processing chef_gem[mixlib-install] action install (c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb line 32)
[2017-08-11T14:33:51-04:00] INFO: mixlib-install gem not found. Installing now
[2017-08-11T14:33:51-04:00] INFO: Processing chef_gem[mixlib-install] action install (c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb line 32)
[2017-08-11T14:33:53-04:00] WARN: NO c:/opscode/chef.upgrade DIR TO ROLL BACK TO!
[2017-08-11T14:33:54-04:00] INFO: Running queued delayed notifications before re-raising exception
[2017-08-11T14:33:54-04:00] ERROR: Running exception handlers
[2017-08-11T14:33:54-04:00] INFO: event=chef_client_logger status=failure chef_node=node.fqdn chef_server=https://server/organizations/org platform_family=windows platform=windows platform_version=6.1.7601 domain=fqdn ip_address=10.10.10.10 exception='chef_client_updater[Install 13.0.118] (devops_chef_client_updater::ccupd line 28) had an error: Mixlib::Install::Options::InvalidOptions: Must provide platform, platform version and architecture when specifying any platform details
'
[2017-08-11T14:33:54-04:00] ERROR: Exception handlers complete
[2017-08-11T14:33:54-04:00] INFO: Sending resource update report (run-id: 85288b72-ef9b-474e-849f-41780cdfddc3)
[2017-08-11T14:33:55-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
[2017-08-11T14:33:55-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report

Support for D: installs?

I can't tell by looking at the code, but would this cookbook support upgrading on a D: installation of chef-client? In other words would it preserve the drive on which the chef-client is installed?

After update, chef-client not recognized and scheduled tasks do not run

Cookbook version

3.1.0

Chef-client version

several < 12.21.26. Really any version (tried updating to 13.X too)

Platform Details

Windows Server 2012 R2

Scenario:

Update chef client w/ cookbook. Chef client runs after update.

Steps to Reproduce:

chef_client_updater 'Install latest Chef 12.x' do
version '12'
end

Let chef execute as scheduled task or run chef-client manually.

Expected Result:

Chef-client is updated and runs as before. This is what happens if the .msi is run to update the chef client.

Actual Result:

Regardless of task or manual execution of update, afterward chef never runs again (despite task existing and running as scheduled). Attempting to run manually results in "chef-client is not the name of a cmdlet, etc". No new chef-client version is listed in Programs and Features. Try to uninstall old version, says it's gone. Installing manually via .msi fails. After reboot, chef works normally.

Downgrading on windows does not work.

Cookbook version

3.0.4

Chef-client version

13.3.42

Platform Details

Windows 2012R2

Scenario:

Downgrade chef-client version.

Steps to Reproduce:

  1. Install chef client by url. From the docs:
. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install
  1. Bootstrap the node
  2. Set the desired version to lower than latest to get the updater to downgrade (any lower version)
  3. Run chef client to trigger the downgrade
  4. Fail the downgrade

Expected Result:

The node to be downgraded successfully

Actual Result:

The node fails to install the older package, but succeeds in rescuing and restoring the current version. Manually trying to install an older package through the GUI doesn't work either, nor trying to install an older package using the command above with version pin. When manually trying to install an older package in the GUI, an error is shown saying a newer version is already present before forcing an exit. The command line produces a nondescript error. I believe the problem is not really in this cookbook, but the windows package which refuses to allow downgrades.

Errno::ENOENT: chef_client_updater[Update chef version] (cr_meta_base::default line 18) had an error: Errno::ENOENT: No such file or directory @ realpath_rec - C:/opscode/chef
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/formatters/error_description.rb:80:in `realpath'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/formatters/error_description.rb:80:in `error_context_info'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/formatters/error_description.rb:50:in `display'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/formatters/base.rb:109:in `display_error'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/formatters/base.rb:140:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/formatters/doc.rb:313:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource.rb:603:in `rescue in run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource.rb:589:in `run_action'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:233:in `execute_install_script'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:253:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:202:in `converge_by'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:247:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:211:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:211:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:171:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource.rb:591:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:70:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:98:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:98:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:98:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:97:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:273:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:249:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:232:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:458:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:457:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:457:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:441:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:58:in `load'
C:/opscode/chef/bin/chef-client:58:in `<main>'

>>>> Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/2/chef-script20170829-84-74mtu3.ps1" ----
STDOUT: Installing chef from C:\Users\ADMINI~1\AppData\Local\Temp\2\chef-client-13.0.118-1-x64.msi
STDERR: C:\Users\Administrator\AppData\Local\Temp\2\chef-script20170829-84-74mtu3.ps1 : msiexec was not successful. Received 

exit code 1603

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,chef-script20170829-84-74mtu3.ps1
---- End output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/2/chef-script20170829-84-74mtu3.ps1" ----
Ran "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/ADMINI~1/AppData/Local/Temp/2/chef-script20170829-84-74mtu3.ps1" returned 1
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2-universal-mingw32/lib/mixlib/shellout.rb:293:in `invalid!'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/mixlib-shellout-2.3.2-universal-mingw32/lib/mixlib/shellout.rb:280:in `error!'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/mixin/shell_out.rb:130:in `shell_out_with_systems_locale!'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider/execute.rb:58:in `block in action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:202:in `converge_by'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider/execute.rb:56:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider/script.rb:64:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider/windows_script.rb:57:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider/powershell_script.rb:35:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:171:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource.rb:591:in `run_action'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:233:in `execute_install_script'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:253:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:202:in `converge_by'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:247:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:211:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:211:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/provider.rb:171:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource.rb:591:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:70:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:98:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:98:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:98:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/runner.rb:97:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:273:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:249:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:232:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:458:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:457:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:457:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application/client.rb:441:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.3.42-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:58:in `load'
C:/opscode/chef/bin/chef-client:58:in `<main>'

Errno::ENOENT: No such file or directory @ realpath_rec - C:/opscode/chef

Cookbook version

2.0.1

Chef-client version

latest (via TestKitchen)

Platform Details

TestKitchen
Windows Server 2012r2

Scenario:

Trying to see if I can downgrade chef-client from chef13 to chef11 or chef12

Steps to Reproduce:

Metadata:
depends 'windows', '> 3.1.1'
depends 'chef-client', '
> 8.1.2'
depends 'chef_client_updater', '~> 2.0.1'

Attributes File:
default['chef_client_updater']['version'] = '12.20.3'
default['chef_client_updater']['prevent_downgrade'] = false
default['chef_client_updater']['post_install_action'] = 'kill'

recipe:
include_recipe 'chef_client_updater::default' # updates chef client
include_recipe 'chef-client::default'

Expected Result:

Error to not happen and chef version in C:/opscode/chef to be the version that I specified.

Actual Result:

         - moving all files under c:/opscode/chef.upgrade to c:/opscode/chef
         ================================================================================
         Error executing action `update` on resource 'chef_client_updater[update chef-client]'
         ================================================================================

         Errno::ENOENT
         -------------
         No such file or directory @ realpath_rec - C:/opscode/chef

         Resource Declaration:
         ---------------------
         # In C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb

   20: chef_client_updater 'update chef-client' do
   21:   channel node['chef_client_updater']['channel']
   22:   version node['chef_client_updater']['version']
   23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
   24:   post_install_action node['chef_client_updater']['post_install_action']
   25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override']
   26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
   27: end

         Compiled Resource:
         ------------------
         # Declared in C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

         chef_client_updater("update chef-client") do
    action [:update]
    updated true
    updated_by_last_action true
    default_guard_interpreter :default
    declared_type :chef_client_updater
    cookbook_name "chef_client_updater"
    recipe_name "default"
    channel "stable"
    version "12.20.3"
    prevent_downgrade false
    post_install_action "kill"
         end

         System Info:
         ------------
         chef_version=13.1.31
         platform=windows
         platform_version=6.3.9600
         ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x64-mingw32]
         program_name=C:/opscode/chef/bin/chef-client
         executable=C:/opscode/chef/bin/chef-client


     Running handlers:
   [2017-06-19T09:07:53-07:00] ERROR: Running exception handlers
     Running handlers complete
   [2017-06-19T09:07:53-07:00] ERROR: Exception handlers complete
     Chef Client failed. 1 resources updated in 23 seconds
   [2017-06-19T09:07:53-07:00] FATAL: Stacktrace dumped to C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
   [2017-06-19T09:07:53-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-06-19T09:07:53-07:00] FATAL: Errno::ENOENT: chef_client_updater[update chef-client] (chef_client_updater::default line 20) had an error: Errno::ENOENT: No such file or directory @ realpath_rec - C:/opscode/chef
$$$$$$           + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep
$$$$$$           + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-win-2012>.  Please see .kitchen/logs/default-
win-2012.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

As far as I can tell, it's moving the c:/opscode/chef folder to c:/opscode/chef.snapshot (or whatever) and then the install script is failing to update c:/opscode/chef because it doesn't exist or something.

Error executing action 'update' on resource 'chef_client_updater[update_chef-client]'

Cookbook version

3.2.9

Chef-client version

12.8.1

Platform Details

Windows Server 2012 R2 Datacenter

Scenario:

Trying to upgrade to Chef 14 by putting the chef_client_updater recipe or resource at the beginning of my run-list

Steps to Reproduce:

I first tried to use just the chef_client_updater resource and then tried to just include the recipe, and both gave the same error. I also tried to manually run chef_upgrade.ps1, and it didn't run even though it's a valid file.

Expected Result:

I'm expecting for this resource/recipe to converge and update Chef client on the node.

Actual Result:

Error executing action 'update' on resource 'chef_client_updater[update_chef-client]'
#<NoMethodError: chef_client_updater[update chef-client] (chef_client_updater::default line 25) had an error: NoMethodError: undefined method `[]' for nil:NilClass> had an error:
chef_client_updater[update chef-client] (chef_client_updater::default line 25) had an error: NoMethodError: undefined method `[]' for nil:NilClass

Description:

Error executing action `update` on resource 'chef_client_updater[update chef-client]'

NoMethodError

undefined method `[]' for nil:NilClass

Cookbook Trace:

c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:351:in `rescue in block in class_from_file'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:330:in `block in class_from_file'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

Resource Declaration:

# In c:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

 25: chef_client_updater 'update chef-client' do
 26:   channel node['chef_client_updater']['channel']
 27:   version node['chef_client_updater']['version']
 28:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
 29:   post_install_action node['chef_client_updater']['post_install_action']
 30:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override']
 31:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
 32:   upgrade_delay node['chef_client_updater']['upgrade_delay'] unless node['chef_client_updater']['upgrade_delay'].nil?
 33:   product_name node['chef_client_updater']['product_name'] if node['chef_client_updater']['product_name']
 34: end

Compiled Resource:

# Declared in c:/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:25:in `from_file'

chef_client_updater("update chef-client") do
  action [:update]
  updated true
  updated_by_last_action true
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  declared_type :chef_client_updater
  cookbook_name "chef_client_updater"
  recipe_name "default"
  channel "stable"
  version "14.0.190"
  prevent_downgrade true
  post_install_action "kill"
  product_name "chef"
end

Stacktrace

c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:351:in `rescue in block in class_from_file'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:330:in `block in class_from_file'
(eval):2:in `block in action_update'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/provider.rb:360:in `instance_eval'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/provider.rb:360:in `compile_and_converge_action'
(eval):2:in `action_update'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/provider.rb:144:in `run_action'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource.rb:596:in `run_action'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/resource_list.rb:84:in `block in execute_each_resource'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/resource_collection/resource_list.rb:82:in `execute_each_resource'
c:/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:668:in `block in converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:663:in `catch'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:663:in `converge'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:702:in `converge_and_save'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/client.rb:280:in `run'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:252:in `run_with_graceful_exit_option'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:228:in `block in run_chef_client'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:211:in `run_chef_client'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application/client.rb:417:in `run_application'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/lib/chef/application.rb:58:in `run'
c:/opscode/push-jobs-client/embedded/lib/ruby/gems/2.1.0/gems/chef-12.8.1-universal-mingw32/bin/chef-client:26:in `<top (required)>'
c:/opscode/push-jobs-client/bin/chef-client:63:in `load'
c:/opscode/push-jobs-client/bin/chef-client:63:in `<main>'

Unsuccessful upgrades when other processes have open handles in chef_install_dir

Cookbook version

3.2.6

Platform Details

Windows

Scenario:

A frequent problem we encounter when trying to use this cookbook is the upgrade script failing to remove the chef install dir due to open file handles. This is usually because of AV/endpoint protection or similar software.

This causes the upgrade script to fail and chef-client is left in an inoperable state requiring manual intervention.

Steps to Reproduce:

Open a file in the chef install dir in another process and run the cookbook.

Chef_Client_Updater 3.0.3 exit error

Cookbook version

[3.0.3]

Chef-client version

[12.13.37]

Platform Details

[Windows 2012 r2 - Redat 5x 6x]

Scenario:

[the update chef client done but the cookbook finish with error, but if i restart cookbook all is fine ]

Steps to Reproduce:

[i start chef-client -o chef_client_updater and i have error message but the chef-client upgrade is work]

  • chef_client_updater[update chef-client] action update[2017-08-11T11:10:28+02:00] INFO: Processing chef_client_updater[update chef-client] action update (chef_client_upda

    • remove c:/opscode/chef.upgrade from previous chef-client run
    • upgrade rubygems 2.6.6 to latest[2017-08-11T11:10:45+02:00] INFO: mixlib-install gem not found. Installing now
    • chef_gem[mixlib-install] action install[2017-08-11T11:10:45+02:00] INFO: Processing chef_gem[mixlib-install] action install (c:/chef/cache/cookbooks/chef_client_update
      [2017-08-11T11:10:50+02:00] INFO: chef_gem[mixlib-install] installed mixlib-install at >= 3.3.1

      • install version >= 3.3.1 of package mixlib-install
    • chef_gem[mixlib-install] action install[2017-08-11T11:10:50+02:00] INFO: Processing chef_gem[mixlib-install] action install (c:/chef/cache/cookbooks/chef_client_update
      (up to date)

[2017-08-11T11:10:50+02:00] WARN: Skipping final node save because override_runlist was given
[2017-08-11T11:10:50+02:00] INFO: Chef Run complete in 23.221458 seconds
[2017-08-11T11:10:50+02:00] INFO: Skipping removal of unused files from the cache
๏ฟฝ[0m
Running handlers:
[2017-08-11T11:10:51+02:00] INFO: Running report handlers
Running handlers complete
[2017-08-11T11:10:51+02:00] INFO: Report handlers complete
Chef Client finished, 2/3 resources updated in 29 seconds

the problem is just exit in error but it's work

chef_client_updater does not use proxy settings

Cookbook version

2.0.3

Chef-client version

12.20.3

Platform Details

Windows Server 2016

Scenario:

chef_client_updater fails to download the msi package on a node configured to use a proxy (environment variables http_proxy & https_proxy are defined per https://docs.chef.io/proxies.html).

Steps to Reproduce:

  • Set http_proxy and https_proxy environment variables
  • Run chef client with default.rb:
	chef_client_updater "Install 13.2.20 and kill run" do
		version '13.2.20'
		post_install_action 'kill'
	end

Expected Result:

chef_client_updater uses the configured proxy to download

Actual Result:

Generated at 2017-07-08 00:35:57 -0400
Mixlib::ShellOut::ShellCommandFailed: chef_client_updater[Install 13.2.20 and kill run] (base-windows-os::default line 25) had an error: Mixlib::ShellOut::ShellCommandFailed: powershell_script[name] (C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb line 210) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Windows/Temp/chef-script20170708-3396-1fcrmbk.ps1" ----
STDOUT: There was an error: 
	Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
	Unable to connect to the remote server
	No connection could be made because the target machine actively refused it 151.101.0.65:443
STDERR: C:\Windows\Temp\chef-script20170708-3396-1fcrmbk.ps1 : Failed to download from 

https://omnitruck.chef.io/stable/chef/metadata?v=13.2.20&p=windows&pv=2016&m=x8

6_64.

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 

   tion

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 

   n,chef-script20170708-3396-1fcrmbk.ps1
---- End output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Windows/Temp/chef-script20170708-3396-1fcrmbk.ps1" ----
Ran "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Windows/Temp/chef-script20170708-3396-1fcrmbk.ps1" returned 1
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7-universal-mingw32/lib/mixlib/shellout.rb:289:in `invalid!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7-universal-mingw32/lib/mixlib/shellout.rb:276:in `error!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/mixin/shell_out.rb:118:in `shell_out!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/execute.rb:62:in `block in action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/execute.rb:60:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/script.rb:64:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/windows_script.rb:57:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/powershell_script.rb:35:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:215:in `execute_install_script'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:235:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:229:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Windows/Temp/chef-script20170708-3396-1fcrmbk.ps1" ----
STDOUT: There was an error: 
	Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
	Unable to connect to the remote server
	No connection could be made because the target machine actively refused it 151.101.0.65:443
STDERR: C:\Windows\Temp\chef-script20170708-3396-1fcrmbk.ps1 : Failed to download from 

https://omnitruck.chef.io/stable/chef/metadata?v=13.2.20&p=windows&pv=2016&m=x8

6_64.

    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 

   tion

    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 

   n,chef-script20170708-3396-1fcrmbk.ps1
---- End output of "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Windows/Temp/chef-script20170708-3396-1fcrmbk.ps1" ----
Ran "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Windows/Temp/chef-script20170708-3396-1fcrmbk.ps1" returned 1
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7-universal-mingw32/lib/mixlib/shellout.rb:289:in `invalid!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7-universal-mingw32/lib/mixlib/shellout.rb:276:in `error!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/mixin/shell_out.rb:118:in `shell_out!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/execute.rb:62:in `block in action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/execute.rb:60:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/script.rb:64:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/windows_script.rb:57:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider/powershell_script.rb:35:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:215:in `execute_install_script'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:235:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
C:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:229:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:715:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:710:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/client.rb:286:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.20.3-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

GET request being made by the script works on the same node when specifying the system proxy:

PS> iwr "https://omnitruck.chef.io/stable/chef/metadata?v=13.2.20&p=windows&pv=2016&m=x86_64" -Proxy $env:http_proxy -UseBasicParsing


StatusCode        : 200
StatusDescription : OK
Content           : sha1        84512ff31ea4cd422931aee00e348a1c633d711b
                    sha256      82772d31ad110b7a584492f3a51358a56f4d706a41920c0d441b87c94b71336c
                    url https://packages.chef.io/files/stable/chef/13.2.20/windows/2016/chef-client-13...
RawContent        : HTTP/1.1 200 OK
                    X-Content-Type-Options: nosniff
                    X-Frame-Options: SAMEORIGIN
                    X-XSS-Protection: 1; mode=block
                    Age: 10
                    Connection: keep-alive
                    X-Served-By: cache-iad2143-IAD
                    X-Cache: HIT
                    X-Cache-H...
Forms             :
Headers           : {[X-Content-Type-Options, nosniff], [X-Frame-Options, SAMEORIGIN], [X-XSS-Protection, 1; mode=block], [Age, 10]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        :
RawContentLength  : 231

Chef terminated during upgrade attempt.

Hi, there. We are experiencing troubles with Chef client upgrade using chef_client_updater cookbook. There are 2 issues:

  1. Normally, this cookbook terminates chef client in kitchen, and I cannot solve it according to suggestion In order to test this cookbook it will be necessary to change the post_install_action to exec from kill. I try to do it and Chef fails with error:
        Recipe: chef_client_updater::default
          * chef_client_updater[update chef-client] action update
            * chef_gem[mixlib-install] action install
       - install version ~> 3.9 of package mixlib-install
            * powershell_script[name] action runSUCCESS: The scheduled task "Chef_upgrade" has successfully been created.

       - execute "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -Execut
ionPolicy Bypass -InputFormat None -File "C:/Users/vagrant/AppData/Local/Temp/chef-script20180124-2776-1lq0zy7.ps1"
            - upgrade chef-client 13.5.3 to 13.6.4[2018-01-24T06:50:58-08:00] WARN: post_install_action "exec" not supp
orted for chef-client running forked -- changing to "kill".
      [2018-01-24T06:50:58-08:00] WARN: forcing "exec" to "kill" on windows.
      [2018-01-24T06:50:58-08:00] WARN: New chef-client installed. Forcing chef exit!
  1. Second issue if it's used in real environment (with post_install_action kill) chef client is aborted and the rest of cookbooks in runlist aren't called. I believe it's caused by line
    Kernel.spawn('c:/windows/system32/schtasks.exe /F /RU SYSTEM /create /sc minute /mo 1 /tn Chef_upgrade /tr "powershell.exe -ExecutionPolicy Bypass c:/opscode/chef_upgrade.ps1"')

Could you [lease confirm it's expected behavior or bugs?

Platform is Windows 2012. I upgrade chef-client 13.5.3 to 13.6.4. Cookbook version is 3.2.0.

Thanks,
Yury.

Upgrading chef-client on windows.

Thanks for sharing this, I only watch your youtube video this morning and thought I would give it ago.

Cookbook version

1.0.0

Chef-client version

12.18.31

Platform Details

Windows 2012 R2

Scenario:

Testing upgrading the preinstalled chef-client in my windows box

Steps to Reproduce:

I have version 12.18.31 of the chef-client already installed and I was looking to test having this upgraded.

Expected Result:

latest stable for me is 12.19.36 so I was expecting it to upgrade.

Actual Result:

Firstly I'll be upfront I did comment out
# require_chef_omnibus: '12.13.37' in my kitchen.yml as it was trying to down grade my chef client and I thought this was part of the problem.

-----> Converging <default-win2012r2>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 5.2.0...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
       Transferring files to <default-win2012r2>
       Starting Chef Client, version 12.18.31
       resolving cookbooks for run list: ["chef_client_updater::default"]
       Synchronizing Cookbooks:
         - compat_resource (12.16.3)
         - chef_client_updater (1.0.0)
       Installing Cookbook Gems:
       Compiling Cookbooks...
       Converging 1 resources
       Recipe: chef_client_updater::default
         * chef_client_updater_updater[update chef-client] action update[2017-03-31T16:00:25+01:00] WARN: New chef-client installed. Forcing chef exit!


           ================================================================================
           Error executing action `update` on resource 'chef_client_updater_updater[update chef-client]'
           ================================================================================

           SystemExit
           ----------
           exit

           Resource Declaration:
           ---------------------
           # In C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb

            20: chef_client_updater 'update chef-client' do
            21:   channel node['chef_client_updater']['channel']
            22:   version node['chef_client_updater']['version']
            23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
            24:   post_install_action node['chef_client_updater']['post_install_action']
            25: end

           Compiled Resource:
           ------------------
           # Declared in C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

           chef_client_updater_updater("update chef-client") do
             action [:update]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :chef_client_updater
             cookbook_name "chef_client_updater"
             recipe_name "default"
             channel "stable"
             version "latest"
             prevent_downgrade true
             post_install_action "kill"
           end

           Platform:
           ---------
           x64-mingw32


       Running handlers:
       [2017-03-31T16:00:26+01:00] ERROR: Running exception handlers
       Running handlers complete
       [2017-03-31T16:00:26+01:00] ERROR: Exception handlers complete
       Chef Client failed. 0 resources updated in 39 seconds
       [2017-03-31T16:00:26+01:00] FATAL: Stacktrace dumped to C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
       [2017-03-31T16:00:26+01:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       Starting Chef Client, version 12.18.31
       resolving cookbooks for run list: ["chef_client_updater::default"]
       Synchronizing Cookbooks:
         - compat_resource (12.16.3)
         - chef_client_updater (1.0.0)
       Installing Cookbook Gems:
       Compiling Cookbooks...
       Converging 1 resources
       Recipe: chef_client_updater::default
         * chef_client_updater_updater[update chef-client] action update[2017-03-31T16:01:09+01:00] WARN: New chef-client installed. Forcing chef exit!


           ================================================================================
           Error executing action `update` on resource 'chef_client_updater_updater[update chef-client]'
           ================================================================================

           SystemExit
           ----------
           exit

           Resource Declaration:
           ---------------------
           # In C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb

            20: chef_client_updater 'update chef-client' do
            21:   channel node['chef_client_updater']['channel']
            22:   version node['chef_client_updater']['version']
            23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
            24:   post_install_action node['chef_client_updater']['post_install_action']
            25: end

           Compiled Resource:
           ------------------
           # Declared in C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

           chef_client_updater_updater("update chef-client") do
             action [:update]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :chef_client_updater
             cookbook_name "chef_client_updater"
             recipe_name "default"
             channel "stable"
             version "latest"
             prevent_downgrade true
             post_install_action "kill"
           end

           Platform:
           ---------
           x64-mingw32


       Running handlers:
       [2017-03-31T16:01:10+01:00] ERROR: Running exception handlers
       Running handlers complete
       [2017-03-31T16:01:10+01:00] ERROR: Exception handlers complete
       Chef Client failed. 0 resources updated in 37 seconds
       [2017-03-31T16:01:10+01:00] FATAL: Stacktrace dumped to C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/chef-stacktrace.out
       [2017-03-31T16:01:10+01:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-win2012r2>.  Please see .kitchen/logs/default-win2012r2.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

C:\chef-repo\cookbooks\chef_client_updater [gb/windows +0 ~1 -0 !]>

This is my stack trace

Generated at 2017-03-31 16:01:10 +0100
SystemExit: chef_client_updater_updater[update chef-client] (chef_client_updater::default line 20) had an error: SystemExit: exit
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:132:in `exit'
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:132:in `run_post_install_action'
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:36:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:33:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application/client.rb:427:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by SystemExit: exit
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:132:in `exit'
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:132:in `run_post_install_action'
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:36:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/chef_client_updater/resources/updater.rb:33:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application/client.rb:427:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.18.31-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

I'm not seeing any evidence of it downloading the new client or attempting to install it before force quiting the chef run the first time.

If you need anything else let me know

Thanks

Gary

Upgrading on old linux fails to detect correct version

Cookbook version

3.1.0

Chef-client version

12.21.12

Platform Details

Linux ip-10-244-6-170 3.2.0-23-virtual #36-Ubuntu SMP Tue Apr 10 22:29:03 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
AWS - Ubuntu 12.02

Scenario:

Update chef to ~12.

Steps to Reproduce:

Run chef client with an update resource in a cookbook.

Expected Result:

To detect that 12.21.12 is the latest for ubuntu 12.02

Actual Result:

Tries to upgrade to 12.21.26 and assumes it succeeded.

    - upgrade chef-client 12.21.12 to 12.21.26
    ================================================================================
    Error executing action `update` on resource 'chef_client_updater[update chef-client]'
    ================================================================================

    SystemExit
    ----------
    exit

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:176:in `exit'
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:176:in `run_post_install_action'
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:295:in `block (2 levels) in class_from_file'
    /var/chef/cache/cookbooks/chef_client_updater/providers/default.rb:294:in `block in class_from_file'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb

     20: chef_client_updater 'update chef-client' do
     21:   channel node['chef_client_updater']['channel']
     22:   version node['chef_client_updater']['version']
     23:   prevent_downgrade node['chef_client_updater']['prevent_downgrade']
     24:   post_install_action node['chef_client_updater']['post_install_action']
     25:   download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override']
     26:   checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
     27: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/chef_client_updater/recipes/default.rb:20:in `from_file'

    chef_client_updater("update chef-client") do
      action [:update]
      updated true
      updated_by_last_action true
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :chef_client_updater
      cookbook_name "chef_client_updater"
      recipe_name "default"
      channel "stable"
      version "12"
      prevent_downgrade false
      post_install_action "kill"
      exec_command "chef-client"
      exec_args []
    end

    System Info:
    ------------
    chef_version=12.21.12
    platform=ubuntu
    platform_version=12.04
    ruby=ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
    program_name=chef-client worker: ppid=23536;start=16:45:55;
    executable=/opt/chef/bin/chef-client


Running handlers:
Running handlers complete
Chef Client failed. 1 resources updated in 23 seconds

Trying to upgrade manually it seems the latest for 12.02 is 12.21.12:

curl -L https://chef.io/chef/install.sh | sudo bash -s -- -v 12
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 20493  100 20493    0     0   135k      0 --:--:-- --:--:-- --:--:--  909k
ubuntu 12.04 x86_64
Getting information for chef stable 12 for ubuntu...
downloading http://www.chef.io/stable/chef/metadata?v=12&p=ubuntu&pv=12.04&m=x86_64
  to file /tmp/install.sh.25283/metadata.txt
trying wget...
sha1	85e4ba824c71e8c82a512edc97eaeb0236667f4f
sha256	d997a79c4bdaf02397c464a18b1738bb33cbcc939c0898536de22ceee63f200c
url	https://packages.chef.io/files/stable/chef/12.21.12/ubuntu/12.04/chef_12.21.12-1_amd64.deb
version	12.21.12
downloaded metadata file looks valid...
downloading https://packages.chef.io/files/stable/chef/12.21.12/ubuntu/12.04/chef_12.21.12-1_amd64.deb
  to file /tmp/install.sh.25283/chef_12.21.12-1_amd64.deb
trying wget...

While ubuntu 12.02 is past EOL and therefore shouldn't expect support, it would be nice if this didn't break chef on it by exiting without any errors.

Use smarter default for post_install_action

post_install_action should just 'do the right thing' by default, rather than require the user to manually choose between exec or kill settings depending on their use-case.

I saw that the default post_install_action was switched from exec to kill in major-version 3 of this cookbook (#49), to address an issue (#45) that arises from the most common use-case when chef-client runs via forked processes using the --interval option.

In that discussion, @tas50 wondered in a comment,

I wonder if we could make it smarter about just doing the right thing.

You can make it smarter. In my own testing, the 'right thing' is to set the default to kill when running via forked process using the --interval option (in which case Chef::Config[:interval] is present), and exec otherwise. I had an implementation of this back in chef-boneyard/omnibus_updater#105, see the following code:

# Default to 'kill' for long-running, interval-based chef-client
# Default to 'exec' for local-mode and single-run chef-client
default[:omnibus_updater][:upgrade_behavior] =
  Chef::Config[:interval] ? 'kill' : 'exec'

Setting a smarter default with this logic should cover most edge-cases including test-kitchen runs.

Failure to detect installed chef version

Cookbook version

3.0.3

Chef-client version

Tested with 13.0.118, 13.2.20

Platform Details

oracle-6.9

Scenario:

The cookbook appears to be failing to correctly detect the installed version of chef and will restart indefinitely in my recipe. I can't seem to reproduce this outside of my recipe because I haven't isolated what in my recipe causes the behavior. I've confirmed that this symptom is not present with version 3.0.2 which at least narrows down which commits could possibly be the culprit.

Steps to Reproduce:

Unzip this cookbook and run kitchen converge on it.

Expected Result:

chef_client_updater should show (up to date).

Actual Result:

chef_client_updater updates chef and execs a new chef-client which updates chef and execs a new chef-client etc.

New chef-client binary is doesn't come up after upgrade

Cookbook version

13.0.118

Chef-client version

13.1.31

Platform Details

RHEL6 and RHEL7

Scenario:

Trying to upgrade all the nodes in our environment running different versions of chef-client to 13.1.31. We have air-gapped environment. Hence we have setup an internal gem mirror that fetches all the gems necessary for the upgrade.

  • We are using a wrapper cookbook for (https://github.com/chef-cookbooks/chef-client) and setting the chef config and service. We are using config and default recipes.
  • We have a wrapper cookbook for chef_client_updater using all the default attributes except version and download_url_override.

Steps to Reproduce:

  1. Runlist has wrapper cookbook for chef-client and wrapper cookbook for chef_client_updater.
  2. chef upgrade happens - "upgrade chef-client 13.0.118 to 13.1.31[2017-08-24T10:46:37-04:00] WARN: Chef client is running forked with a supervisor. Sending TERM to parent process!". Also see the log - "New chef-client installed. Forcing chef exit!"
  3. Post this chef-client service is not available. Command output below.
    #chef-client -v
    bash: /usr/bin/chef-client: No such file or directory

Expected Result:

I am expecting the new chef binary to be available after upgrade

Actual Result:

chef-client service not found

Add option to restart node after chef-client update.

We use chef to manage a lot of VMs and we have a scheduled task that runs chef-client on boot - and reboots is there are any installs/updates that might not have completed yet. At the moment this recipe leaves the VMs on, but not doing anything, after the chef-client is updated, which require manual intervention. As such it would be really useful if this recipe would allow us to reboot the target after the chef-client has been updated, so that the run may then continue after a reboot.

Note: We use Windows and Linux (Windows doesn't currently support 'exec', it forces 'kill', with seemingly no workaround - which BTW is REALLY annoying behavior!).

unable to use custom path for bin c:/opscode to c:/mypath/opscode

Hello,

Cookbook version

3.0.4

Chef-client version

chef 13.0.118 to 13.4.28

Platform Details

Windows 2012 r2 x64

Scenario:

update chef-client to the same custom path as defined in bootstrap installation

Steps to Reproduce:

Install chef-client with 13.0.118 with path c:\mypath\opscode (instead of default c:\opscode)
Run the chef_client_updater to latest version.

Expected Result:

exepect to have the new version installed to custom path.

Actual Result:

Actually the new version don't care about initial install path and installing to c:\opscode

May we have an attribute to define the path. This attribute will add an argument to msiexec as INSTALLDIR ?

Best Regards :)

Readme - Windows Task Example Change

Cookbook version

2.0.3

Issue

I had issues using the example of the "windows_task". Specifically with the dynamic "start_time" variable.

Current Example

if Chef::VERSION < node['my_update_cookbook']['desired_version']
  run_chef_task_in_ten_minutes = Time.now + 600

  windows_task 'chef-client-upgrade' do
    cwd 'C:\\opscode\\chef\\bin'
    command 'chef-client'
    run_level :highest
    frequency :once
    start_time "#{run_chef_task_in_ten_minutes.hour}:#{run_chef_task_in_ten_minutes.min}"
    action :create
  end
else
  windows_task 'chef-client-upgrade' do
    cwd 'C:\\opscode\\chef\\bin'
    command 'chef-client'
    run_level :highest
    frequency :once
    start_time "#{run_chef_task_in_ten_minutes.hour}:#{run_chef_task_in_ten_minutes.min}"
    action :delete
  end
end

chef_client_updater 'Install latest Chef' do
  post_install_action 'kill'
end

Modified Example

if Chef::VERSION < node['my_update_cookbook']['desired_version']
  run_chef_task_in_ten_minutes = Time.now + 600

  windows_task 'chef-client-upgrade' do
    cwd 'C:\\opscode\\chef\\bin'
    command 'chef-client'
    run_level :highest
    frequency :once
    start_time "#{run_chef_task_in_ten_minutes.strftime('%H:%M')}"
    action :create
  end
else
  windows_task 'chef-client-upgrade' do
    cwd 'C:\\opscode\\chef\\bin'
    command 'chef-client'
    run_level :highest
    frequency :once
    start_time "#{run_chef_task_in_ten_minutes.strftime('%H:%M')}"
    action :delete
  end
end

chef_client_updater 'Install latest Chef' do
  post_install_action 'kill'
end

This:

start_time "#{run_chef_task_in_ten_minutes.hour}:#{run_chef_task_in_ten_minutes.min}"

is changed to this:

start_time "#{run_chef_task_in_ten_minutes.strftime('%H:%M')}"

Only change is to the way I grabbed the "start_time" variable. I needed to do this because the hour and minute was not always formatted properly when the hour or minute happened to be a single digit.
i.e. 12:01 would be 12:1

Thanks,

Dave L.

Windows - possible issue with download_url_override?

Cookbook version

2.0.1

Chef-client version

12.19.36

Platform Details

Windows 2008 R2

Scenario:

Chef run is initiated via knife winrm --winrm-shell elevated -m [hostname] chef-client

Computed resource looks a bit like this:

chef_client_updater 'Upgrade chef-client: 12.20.3' do
  version '12.20.3'
  download_url_override `https://our-internal-repo/chef-client-12.20.3-1-x64.msi
  checksum 'f5b371e3b9356fbda74356a22f4acbea8fa2b359d3d15319d7b77665abcab1bf'
end

Here's the stacktrace. Seems like a cascading failure beginning with the powershell error A parameter cannot be found that matches parameter name 'download_url_override' below.

Generated at 2017-06-16 11:39:16 -0700
NoMethodError: undefined method `missing_extensions?' for nil:NilClass
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/stub_specification.rb:151:in `missing_extensions?'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/basic_specification.rb:71:in `contains_requirable_file?'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1037:in `block in find_by_path'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1036:in `each'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1036:in `find'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1036:in `find_by_path'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:209:in `try_activate'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:22:in `highline'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:131:in `print_line'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:113:in `print_string'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:84:in `block in print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `synchronize'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:44:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:79:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:108:in `display_error'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:140:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:634:in `rescue in run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:620:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by LoadError: cannot load such file -- highline
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:22:in `highline'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:131:in `print_line'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:113:in `print_string'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:84:in `block in print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `synchronize'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:44:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:79:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:108:in `display_error'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:140:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:634:in `rescue in run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:620:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by Errno::EACCES: Permission denied @ rb_sysopen - c:/opscode/chef/embedded/bin/libeay32.dll
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1393:in `initialize'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1393:in `open'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1393:in `block in copy_file'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1392:in `open'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1392:in `copy_file'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1360:in `copy'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:472:in `block in copy_entry'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1498:in `wrap_traverse'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1501:in `block in wrap_traverse'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1500:in `each'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1500:in `wrap_traverse'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:469:in `copy_entry'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:444:in `block in cp_r'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1580:in `block in fu_each_src_dest0'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1578:in `each'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1578:in `fu_each_src_dest0'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:1569:in `fu_each_src_dest'
C:/opscode/chef/embedded/lib/ruby/2.3.0/fileutils.rb:443:in `cp_r'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:196:in `block in move_opt_chef'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:185:in `rescue in move_opt_chef'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:178:in `move_opt_chef'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:237:in `rescue in block in class_from_file'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:216:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by RuntimeError: rm_rf of c:/opscode/chef failed
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:180:in `block in move_opt_chef'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:178:in `move_opt_chef'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:237:in `rescue in block in class_from_file'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:216:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by NoMethodError: undefined method `missing_extensions?' for nil:NilClass
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/stub_specification.rb:151:in `missing_extensions?'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/basic_specification.rb:71:in `contains_requirable_file?'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1037:in `block in find_by_path'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1036:in `each'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1036:in `find'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/specification.rb:1036:in `find_by_path'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:209:in `try_activate'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:22:in `highline'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:131:in `print_line'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:113:in `print_string'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:84:in `block in print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `synchronize'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:44:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:79:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:108:in `display_error'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:140:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:634:in `rescue in run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:620:in `run_action'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:208:in `execute_install_script'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:228:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:222:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by LoadError: cannot load such file -- highline
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
C:/opscode/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:22:in `highline'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:131:in `print_line'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:113:in `print_string'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:84:in `block in print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `synchronize'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:79:in `print'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/indentable_output_stream.rb:44:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:79:in `puts'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:108:in `display_error'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/formatters/base.rb:140:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `resource_failed'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:634:in `rescue in run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:620:in `run_action'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:208:in `execute_install_script'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:228:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:222:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

>>>> Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/S-SQL-~1/AppData/Local/Temp/chef-script20170616-4748-qzoqaj.ps1" ----
STDOUT: 
STDERR: C:\Users\s-sql-www-write-proj\AppData\Local\Temp\chef-script20170616-4748-qzoqa
j.ps1 : A parameter cannot be found that matches parameter name 
'download_url_override'.
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
   tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
   n,chef-script20170616-4748-qzoqaj.ps1
---- End output of "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/S-SQL-~1/AppData/Local/Temp/chef-script20170616-4748-qzoqaj.ps1" ----
Ran "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -InputFormat None -File "C:/Users/S-SQL-~1/AppData/Local/Temp/chef-script20170616-4748-qzoqaj.ps1" returned 1
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7-universal-mingw32/lib/mixlib/shellout.rb:289:in `invalid!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7-universal-mingw32/lib/mixlib/shellout.rb:276:in `error!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/shell_out.rb:118:in `shell_out!'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider/execute.rb:62:in `block in action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider/execute.rb:60:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider/script.rb:64:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider/windows_script.rb:57:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider/powershell_script.rb:35:in `action_run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:208:in `execute_install_script'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:228:in `block (2 levels) in class_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:176:in `converge_by'
c:/chef/cache/cookbooks/chef_client_updater/providers/default.rb:222:in `block in class_from_file'
(eval):2:in `block in action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `instance_eval'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:361:in `compile_and_converge_action'
(eval):2:in `action_update'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/provider.rb:145:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource.rb:622:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:69:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:97:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:94:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:114:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:103:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/resource_collection/resource_list.rb:92:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/2.3.0/forwardable.rb:189:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/runner.rb:96:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:670:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `catch'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:665:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:704:in `converge_and_save'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/client.rb:284:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:277:in `run_with_graceful_exit_option'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:253:in `block in run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:236:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:450:in `interval_run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application/client.rb:434:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.19.36-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:68:in `load'
C:/opscode/chef/bin/chef-client:68:in `<main>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.