criteo-cookbooks / wsus-client

Chef Cookbook to install and configure client for Windows Server Update Services (WSUS)
Apache License 2.0
15 stars 19 forks source link

Getting error while running cookbook on node as below in comment section #36

Closed sapna25 closed 7 years ago

sapna25 commented 7 years ago

Starting Chef Client, version 13.5.3 [2017-10-27T00:27:16-07:00] INFO: Chef 13.5.3 [2017-10-27T00:27:16-07:00] INFO: Platform: x64-mingw32 [2017-10-27T00:27:16-07:00] INFO: Chef-client pid: 1340 [2017-10-27T00:27:16-07:00] INFO: The plugin path C:\chef\ohai\plugins does not exist. Skipping... [2017-10-27T00:27:20-07:00] INFO: Run List is [role[updated_windows_server], recipe[wsus-client]] [2017-10-27T00:27:20-07:00] INFO: Run List expands to [wsus-client] [2017-10-27T00:27:20-07:00] INFO: Starting Chef Run for WindowsNode1 [2017-10-27T00:27:20-07:00] INFO: Running start handlers [2017-10-27T00:27:20-07:00] INFO: Start handlers complete. [2017-10-27T00:27:20-07:00] INFO: Error while reporting run start to Data Collector. URL: https://chefservertest1/organi zations/capgemini/data-collector Exception: 404 -- 404 "Not Found" (This is normal if you do not have Chef Automate) resolving cookbooks for run list: ["wsus-client"] [2017-10-27T00:27:20-07:00] INFO: Loading cookbooks [wsus-client@2.0.0] Synchronizing Cookbooks:

[2017-10-27T00:27:38-07:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers: [2017-10-27T00:27:38-07:00] ERROR: Running exception handlers Running handlers complete [2017-10-27T00:27:38-07:00] ERROR: Exception handlers complete Chef Client failed. 0 resources updated in 22 seconds [2017-10-27T00:27:38-07:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out [2017-10-27T00:27:38-07:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2017-10-27T00:27:38-07:00] FATAL: WIN32OLERuntimeError: wsus_client_update[WSUS updates] (wsus-client::update line 25) had an error: WIN32OLERuntimeError: (in OLE method `Search': ) OLE error code:8024401C in

HRESULT error code:0x80020009 Exception occurred. ******************************************************************************************************************* and this is my chef-stacktrace Generated at 2017-10-27 00:27:38 -0700 WIN32OLERuntimeError: wsus_client_update[WSUS updates] (wsus-client::update line 25) had an error: WIN32OLERuntimeError: (in OLE method `Search': ) OLE error code:8024401C in HRESULT error code:0x80020009 Exception occurred. c:/chef/cache/cookbooks/wsus-client/resources/update.rb:84:in `method_missing' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:84:in `block in updates' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:82:in `tap' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:82:in `updates' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:28:in `block in class_from_file' (eval):2:in `block in action_download' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/provider.rb:211:in `instance_eval' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/provider.rb:211:in `compile_and_converge_action' (eval):2:in `action_download' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/provider.rb:171:in `run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/resource.rb:591:in `run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/runner.rb:70:in `run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-universal-mingw32/lib/chef/runner.rb:98:in `each' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/runner.rb:98:in `block in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.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.4.0/gems/chef-13.5.3-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.5.3-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.5.3-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.5.3-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.5.3-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.5.3-universal-mingw32/lib/chef/runner.rb:97:in `converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:715:in `block in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:710:in `catch' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:710:in `converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:286:in `run' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-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.5.3-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.5.3-universal-mingw32/lib/chef/application.rb:232:in `run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-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.5.3-universal-mingw32/lib/chef/application/client.rb:457:in `loop' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-universal-mingw32/lib/chef/application/client.rb:441:in `run_application' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/application.rb:59:in `run' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/bin/chef-client:26:in `' C:/opscode/chef/bin/chef-client:58:in `load' C:/opscode/chef/bin/chef-client:58:in `
' >>>> Caused by WIN32OLERuntimeError: (in OLE method `Search': ) OLE error code:8024401C in HRESULT error code:0x80020009 Exception occurred. c:/chef/cache/cookbooks/wsus-client/resources/update.rb:84:in `method_missing' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:84:in `block in updates' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:82:in `tap' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:82:in `updates' c:/chef/cache/cookbooks/wsus-client/resources/update.rb:28:in `block in class_from_file' (eval):2:in `block in action_download' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/provider.rb:211:in `instance_eval' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/provider.rb:211:in `compile_and_converge_action' (eval):2:in `action_download' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/provider.rb:171:in `run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/resource.rb:591:in `run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/runner.rb:70:in `run_action' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-universal-mingw32/lib/chef/runner.rb:98:in `each' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/runner.rb:98:in `block in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.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.4.0/gems/chef-13.5.3-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.5.3-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.5.3-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.5.3-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.5.3-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.5.3-universal-mingw32/lib/chef/runner.rb:97:in `converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:715:in `block in converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:710:in `catch' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:710:in `converge' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:749:in `converge_and_save' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/client.rb:286:in `run' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-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.5.3-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.5.3-universal-mingw32/lib/chef/application.rb:232:in `run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-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.5.3-universal-mingw32/lib/chef/application/client.rb:457:in `loop' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-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.5.3-universal-mingw32/lib/chef/application/client.rb:441:in `run_application' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/lib/chef/application.rb:59:in `run' C:/opscode/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.5.3-universal-mingw32/bin/chef-client:26:in `' C:/opscode/chef/bin/chef-client:58:in `load' C:/opscode/chef/bin/chef-client:58:in `
'
Annih commented 7 years ago

Hello @sapna25

The error code 8024401C correspond to a HTTP timeout from the Update server. Could you describe your WSUS server infrastructure ?

From your error report, I guess the current client is a Windows Server 2012R2 (or Windows 8.1) do you have other version of Windows trying to download? Are they impacted by this timeout error?

sapna25 commented 7 years ago

Hi @Annih

My client is a Windows Server 2012R2 and I don't have any other version of windows in my infrastructure.I am trying to download and install patches from my WSUS server and whenever I run chef-client from Rudeck Job on my client node I am getting this error. If set proxies on node then it works., but if I unset it doesn't work.So what will be the exact issue? My server and client node is in the same network so why do I need to set proxy? I am using WINRM to make connection from Rundeck to Windows.

sapna25 commented 7 years ago

Hi @Annih

My client is a Windows Server 2012R2 and I don't have any other version of windows in my infrastructure.I am trying to download and install patches from my WSUS server and whenever I run chef-client from Rudeck Job on my client node I am getting this error. If set proxies on node then it works., but if I unset it doesn't work.So what will be the exact issue? My server and client node is in the same network so why do I need to set proxy? I am using WINRM to make connection from Rundeck to Windows.

Annih commented 7 years ago

Hello @sapna25 Interesting... What kind of proxy are you setting up? Did you debug the WSUS server? Is there any error logs?

Did you try to run chef-client locally? Without rundeck and WinRM?

sapna25 commented 7 years ago

Locally its perfectly running but when I try to run it through rundeck as powershell command (chef-client) it shows above errors.I dont want to use any proxies then how should I do it?

sapna25 commented 7 years ago

Hi @Annih

Locally its perfectly running but when I try to run it through rundeck as powershell command (chef-client) it shows above errors.I dont want to use any proxies then how should I do it?

Annih commented 7 years ago

Humm ok, when running chef via WinRM you're shell is running in a "remoting context", this may introduce many weird behavior.

Would it be OK for you to create a schedule task to run chef? This is a common way to remotely perform "local tasks".

This would mean that your rundeck job should:

  1. create a schedule task running only on demand
  2. call the schedule task
  3. wait for the end of the schedule task

I'm suggesting that, because debugging Windows Update on WinRM context is not trivial :)