Closed mbochenk closed 5 years ago
@twangboy would you mind taking a look at this?
In the mean time, are you aware of the cmd.script state? So that you don't have to have the file.managed and the cmd.run separate?
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.cmd.html#salt.states.cmd.script
Thanks, Daniel
@gtmanfred Thank you - I am aware but somehow did not think to try that one (yet).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Description of Issue/Question
file.managed
andcmd.run
randomly fail on freshly deployed Windows 2008/2012/2016. Windows is deployed viasalt-cloud
on vmware, and provisioned fromsalt-master
viasalt
command. Deployment is automated and called remotely and no user interaction happens with the system before it is finished. Behaviour is the same for 2016.11.2, 2016.11.5 and 2016.11.6.Setup
salt-minion
is configured with default settings bysalt-cloud
. All non-default settings are environment (base or other git branch), nacl, merge strategy and logging levels.Running
file.managed
withtemplate: jinja
randomly fails with'LookupAccountSid', 'A device attached to the system is not functioning.'
or'LookupAccountSid', 'The remote procedure call failed.')
. I have not yet figured out the difference - the last message I see on windows 2008 and the first one on 2016, but that may not be relevant.When I check the system for this file, it is present and looks correctly rendered, owned by
Administrators
and withSYSTEM
granted full access.I cannot find out how to reliably reproduce it, however this happens regularly on new deployment of Windows minion via salt-cloud. By regularly, I mean around 0-3 out of 10 deployments may fail with this error.
cmd.run
produces a slightly different error and may be unrelated, however I suspect that they are, as I either see error forfile
or bothfile
andcmd
. It also seems they may be related both to user profile (system user profile?).If I call these states on a VM I am logged in via rdp I could never reproduce it Same if I call commands directly or execute powershell script. Note that newly provisioned VM has "Administrator" user logged in automatically (when salt is executing user is already logged in and at least that user profile should be available).
I've also noticed that by default salt-cloud installs minion with
multiprocessing: false
however even if I set it totrue
I get the same results.I also cannot find any relevant windows events logged - no related crashes or errors that would state that the device was actually not ready at the moment, etc.
Steps to Reproduce Issue
The state that fails most of the time:
and file itself has some variables set:
The error is for
file.managed
:The debug log is:
alternatively:
and for
cmd.run
:debug log:
Versions Report
Same behaviour for 2016.11.2 and 2016.11.5.