For sanity's sake can you copy the debug code you have in the ruby block to outside of the ruby block (so it runs during compile time)?
Sure, updated gist:
So you don't think it has anything to do with https://github.com/opscode/chef/blob/master/lib/chef/provider/file.rb#L148-L153 as the comment says that reporting won't work.
That's correct, the reporting stuff has to do with explicitly recording before and after state for resources for the purpose of storing that information elsewhere.
I'll need to look at it more in-depth, but at the moment I'm seeing something odd with the names of the resources and the path separators:
localhost [2013-01-02T17:48:42+00:00] INFO: Processing template[C:\Temp\bt97\1.8.9-alpha-01133\Deployment\Settings\CHEF.js] action nothing (Wiggle_Billing::default line /chef/cache/cookbooks/Wiggle_Billing/recipes/default.rb)
localhost [2013-01-02T17:49:36+00:00] INFO: windows_zipfile[unzip_artefacts] sending create action to template[C:/Temp/bt97/1.8.9-alpha-01133/Deployment/Settings/CHEF.js] (immediate)
localhost [2013-01-02T17:49:36+00:00] INFO: Processing template[C:/Temp/bt97/1.8.9-alpha-01133/Deployment/Settings/CHEF.js] action create (Wiggle_Billing::default line /chef/cache/cookbooks/Wiggle_Billing/recipes/default.rb)
localhost [2013-01-02T17:49:37+00:00] INFO: template[C:/Temp/bt97/1.8.9-alpha-01133/Deployment/Settings/CHEF.js] backed up to c:/chef/backup/Temp/bt97/1.8.9-alpha-01133/Deployment/Settings/CHEF.js.chef-20130102174937
On Wednesday, January 2, 2013 at 1:40 PM, Seif Attar wrote:
Thanks for looking into this, let me know if I can help with anything.
I tried to work around the problem by putting all the resources in an if statement instead of having and not_if and notifies (is this even allowed?)
I am getting an error in the template now that I need to set username or group, updated recipe and log:
template resource not notifying · GitHub
Is this with a pristine copy of Chef? I'm curious as to how you're ending up with owner, group, and mode set on that resource. The code you were looking at before would do that (File#load_current_resource_attrs), but it should be skipped on windows.
Is there a better way to work around the problem, so that no changes occur if the file exists?
Is this with a pristine copy of Chef? I'm curious as to how you're ending
up with owner, group, and mode set on that resource. The code you were
looking at before would do that (File#load_current_resource_attrs), but it
should be skipped on windows.
I installed chef on the vm using the msi installer and haven't modified the
code in anyway if that is what you mean by pristine.
It is all mind boggling to me, because it install and executes fine when I
remove the if statement that checks if the file exists in the workaround,
which is why I assumed what I am doing with the if statement is wrong :S
Is this with a pristine copy of Chef? I'm curious as to how you're ending up with owner, group, and mode set on that resource. The code you were looking at before would do that (File#load_current_resource_attrs), but it should be skipped on windows.
I installed chef on the vm using the msi installer and haven't modified the code in anyway if that is what you mean by pristine.
Then can you try commenting out that method? That's the only place I can think of where you'd be getting unix-style permissions attributes getting set on your resource.
It is all mind boggling to me, because it install and executes fine when I remove the if statement that checks if the file exists in the workaround, which is why I assumed what I am doing with the if statement is wrong :S
Then can you try commenting out that method? That's the only place I can
think of where you'd be getting unix-style permissions attributes getting
set on your resource.
I commented out all lines inside File#load_current_resource_attrs and added
Then can you try commenting out that method? That's the only place I can think of where you'd be getting unix-style permissions attributes getting set on your resource.
I commented out all lines inside File#load_current_resource_attrs and added
And then I get the same exception Must specify username, group or SID: 0
Okay, then we need to track down where these values are being set. Try this:
class Chef
class Resource
class Template
def mode(*args)
unless args.empty?
Chef::Log.warn("Template mode being set to '#{args.inspect}' from:")
Chef::Log.warn(caller.join("\n"))
end
super
end
end
end
end
Okay, then we need to track down where these values are being set. Try
this:
class Chef
class Resource
class Template
def mode(*args)
unless args.empty?
Chef::Log.warn("Template mode being set to '#{args.inspect}'
from:")
Chef::Log.warn(caller.join("\n"))
end
super
end
end
end
end
Wasn't sure where to add this, but managed to crowbar it into the template
mixin. output: