tl;dr everytime we update this cookbook file we get a EACCESS error on Windows machines
We have a YAML file we drop on every machine (which is consumed by Ohai). On Windows whenever this file changes we get EACCESS errors every time. This breaks all our Windows servers. We’ve written some hacky fixes (something watches logs and nukes the cached and final version. On a fresh run we’re ok.
Error message (obfuscated) :
================================================================================
Error executing action `create` on resource 'cookbook_file[C:/Some/Dir/stuff.yml]'
================================================================================
Errno::EACCES
-------------
Permission denied @ rb_file_s_rename - (C:/Users/GSANCH~1/AppData/Local/Temp/11/chef-rest20160922-16016-1x92dpv, C:/
Chef/cache/cookbooks/my_cookbook/files/default/stuff.yml)
Resource Declaration:
---------------------
# In C:/Chef/cache/cookbooks/my_cookbook/recipes/stuff.rb
36: cookbook_file node['my_cookbook']['stuff_path'] do
37: source 'stuff.yml'
38: unless platform?('windows')
39: owner root_owner
40: group root_group
41: mode '0644'
42: end
43: notifies :reload, 'ohai[reload_datacenter]', :immediately
Compiled Resource:
------------------
# Declared in C:/Chef/cache/cookbooks/my_cookbook/recipes/stuff.rb:36:in `from_file'
cookbook_file("C:/Some/Dir/stuff.yml") do
provider Chef::Provider::CookbookFile
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
source "stuff.yml"
cookbook_name "my_cookbook"
path "C:/Some/Dir/stuff.yml"
declared_type :cookbook_file
recipe_name "stuff"
end
Platform:
---------
x64-mingw32
Any thoughts on how to best troubleshoot this? This error is on a box running 12.14 but I’ve tried watching w/ procmon with no luck.