Skip to content

Instantly share code, notes, and snippets.

@TheSultan
Last active January 1, 2016 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheSultan/8140309 to your computer and use it in GitHub Desktop.
Save TheSultan/8140309 to your computer and use it in GitHub Desktop.
Chef File Resource Win32APIError
Recipe: <REDACTED>
* file[C:\Windows/system32/cmd.exe] action create[2013-12-26T18:38:07-05:00] INFO: Processing file[C:\Windows/system32/cmd.exe] action create (symp
================================================================================
Error executing action `create` on resource 'file[C:\Windows/system32/cmd.exe]'
================================================================================
Chef::Exceptions::Win32APIError
-------------------------------
The operation completed successfully.
---- Begin Win32 API output ----
System Error Code: 0
System Error Message: The operation completed successfully.
---- End Win32 API output ----
Resource Declaration:
---------------------
# In c:/chef/cache/cookbooks/<REDACTED>
32: file File.join(ENV['WINDIR'], sys_dir, 'cmd.exe') do
33: rights :read, "BATCH"
34: end
35: end
Compiled Resource:
------------------
# Declared in c:/chef/cache/cookbooks/<REDACTED>:32:in `block in from_file'
file("C:\Windows/system32/cmd.exe") do
provider Chef::Provider::File
action "create"
retries 0
retry_delay 2
path "C:\\Windows/system32/cmd.exe"
backup 5
atomic_update true
cookbook_name "<REDACTED>"
recipe_name "<REDACTED>"
rights [{:permissions=>:read, :principals=>"BATCH"}]
end
[2013-12-26T18:38:07-05:00] INFO: Running queued delayed notifications before re-raising exception
[2013-12-26T18:38:07-05:00] ERROR: Running exception handlers
[2013-12-26T18:38:07-05:00] ERROR: Exception handlers complete
[2013-12-26T18:38:07-05:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
Chef Client failed. 2 resources updated
[2013-12-26T18:38:07-05:00] FATAL: Chef::Exceptions::Win32APIError: file[C:\Windows/system32/cmd.exe] (<REDACTED> line 32) had an error:
---- Begin Win32 API output ----
System Error Code: 0
System Error Message: The operation completed successfully.
---- End Win32 API output ----
Generated at 2013-12-26 18:38:07 -0500
Chef::Exceptions::Win32APIError: file[C:\Windows/system32/cmd.exe] (<REDACTED> line 32) had an error: Chef::Exceptions::Win32APIError: The operation completed successfully.
---- Begin Win32 API output ----
System Error Code: 0
System Error Message: The operation completed successfully.
---- End Win32 API output ----
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/win32/error.rb:69:in `raise!'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/win32/security.rb:420:in `set_named_security_info'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/win32/security/securable_object.rb:74:in `dacl='
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/file_access_control/windows.rb:143:in `set_dacl'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/file_access_control/windows.rb:41:in `set_all'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/provider/file.rb:376:in `block in do_acl_changes'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/mixin/why_run.rb:52:in `call'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/mixin/why_run.rb:52:in `add_action'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/provider.rb:149:in `converge_by'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/provider/file.rb:375:in `do_acl_changes'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/provider/file.rb:121:in `action_create'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/provider.rb:114:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource.rb:625:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/runner.rb:49:in `run_action'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/runner.rb:81:in `block (2 levels) in converge'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/runner.rb:81:in `each'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/runner.rb:81:in `block in converge'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/resource_collection.rb:96:in `execute_each_resource'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/runner.rb:80:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/client.rb:433:in `converge'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/client.rb:500:in `do_run'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/client.rb:213:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/application.rb:208:in `run_chef_client'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/application/client.rb:312:in `block in run_application'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/application/client.rb:304:in `loop'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/application/client.rb:304:in `run_application'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/lib/chef/application.rb:66:in `run'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.2-x86-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chef/bin/chef-client:23:in `load'
C:/opscode/chef/bin/chef-client:23:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment