Open emachnic opened 7 years ago
Please let me know if v3.0.2 fixed this issue
Hi @dhoer, tried with version 3.0.2 and this is still an issue. Thanks for looking into it.
What platform and chef-client version is this occurring on?
This is on Windows Server 2012R2 with Chef 12.21.1
Does changing the attribute from ENV['WINDIR']
to '%WINDIR%'
fix the issue?
From #chef irc chat: <@cheeseplus> dhoer: based on my reading of that that, the place they're trying to put the file doesn't already exist
IMHO this is not completly related to nssm
cookbook but more due to consul
cookbook weird usage.
In consul cookbook the nssm.install_location
value is overridden from ENV['WINDIR']
to %WINDIR%
(https://github.com/johnbellone/consul-cookbook/blob/master/recipes/default.rb#L7)
I agreeat that it appears that a recent change in nssm
broke consul
behavior, but the faulty line in consul
cookbook shouldn't be here :)
I'm preparing a PR for the consul
cookbook to be compatible with #21
Has that PR been submitted to consul cookbook?
Not yet, I'm waiting for @dhoer to release the 4.0 version of nssm cookbook ^^
Understandable - do you know offhand what the last working pin would be? nssm 3.0.0 + consul 3.0.0? Looks like the referenced line (overriding install_location
to %WINDIR%
) has been around a long time.
the change from %WINDIR% to ENV['WINDIR'] was because on some systems it was failing to expand the %WINDIR% into the correct path. In ruby the correct method for getting environment variables is using the ENV[] syntax as that will work reliably.
This is from my experience in using the environment variables.
@aprice Also to answer your question, from what i can tell i think this issue might be chef version dependent because the attribute is being used directly in the remote_file resource (in versions <=3.0.1) and the paths no longer expanding may have been a change in more recent chef versions and how they copy files which broke the nssm cookbook and required the change to the proper ruby method for expanding that environment variable. 3.0.1 should be working otherwise the behavior of remote_file may have changed in chef.
@Annih the change in the consul cookbook to properly expand the environment attribute shouldn't depend on the release of 4.0 since the changes in 4.0 dont fix or break anything in that regard.
@axelrtgs I'm not saying the fix should depends on v4.0. I'm just saying I'll not provide a PR on consul cookbook until v4.0 is released :)
Makes sense, i was just thinking more form the interest of getting it fixed sooner but i also understand wanting to wait for the latest release
It appears that whatever was changed between version 3.0.0 and 3.0.1 has caused a break in the consul cookbook. I'm creating this issue so you can be aware. Here is the stacktrace: