Closed huamichaelchen closed 6 years ago
Hey There It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you. Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.
If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.
Hi @huamichaelchen - the behaviour you experienced is by design, we want the current Chef Client to exit as fast as possible after setting up a scheduled task containing the PowerShell script required to run the real upgrade. If this didn't work for you, have a look in your c:\opscode folder for a log file and join us in the #windows channel in Chef Community Slack. I'm going to close this issue for now but will open a new issue if we find a defect to solve. Thanks!
@stuartpreston Thank you for the response :)
I just want to confirm a few things.
Cookbook version
chef_client_updater: 3.3.4
Chef-client version
12.12.15
Platform Details
[Operating system distribution and release version. Cloud provider if running in the cloud] windows 2012 r2
Scenario:
[What you are trying to achieve and you can't?] I'm trying to upgrade chef client from 12.12.15 to the latest by running the cookbook
Steps to Reproduce:
[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
I wrote a wrapper cookbook so that we can overwrite certain attributes.
Expected Result:
[What are you expecting to happen as the consequence of above reproduction steps?] Hoped it would successfully updated our chef-client from 12.12.15 to 14.3.37
Actual Result:
[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]
chef-client run failed with the following:
Potential reason for this behavior
I think the reason it was success with the windows 2012r2 update is because
The code sets to post_installation_action to 'kill' no matter what we pass in.
Then it won't go into this block, because of
!windows?
https://github.com/chef-cookbooks/chef_client_updater/blob/a4b30066168f862759cf3e6c55a8cce15bed343e/providers/default.rb#L197-L198Finally, all it can do is raise the error and exit https://github.com/chef-cookbooks/chef_client_updater/blob/a4b30066168f862759cf3e6c55a8cce15bed343e/providers/default.rb#L201-L203
In other words, for windows, chef_client_updater cookbook, the post_installation_action is always set to 'kill' no matter what you pass in, then it won't go into the kill case/when logic because of the !windows?. Eventually, all it can do is raise error and exit...