-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intermittent "failed to run exec_wrapper action module_powershell_wrapper: Failed to compile C# code" errors #657
Comments
Unfortunately there is not much we can do here, the process to compile the code uses We do provide a way to change the temporary directory used here through the remote_tmp option on the shell plugin. This could potentially be changed to a location that is either trusted by the AV or maybe less likely for it to be scanned and locked during the run. |
As far as I can see, this directory could simply be used by an attacker as well, creating an attack vector? (Unless the code is signed - which I'm sure it isn't.. That said - signing of the temporary code done by the ansible controller DOES sound like an interesting idea!) Anyway - wouldn't a retry/backoff mechanism pretty much solve this problem? Since this is only occuring every couple thousand task executions, it seems very much like unlucky timing. |
It's certainly not idea but potentially just changing it to another var and not the default
It's certainly something we are looking into potentially but there are a lot of questions it brings up which make it hard to achieve.
Not necessarily, in some cases maybe but in others it could just fail everytime. In other cases there could be code out of our control that uses One area I want to also look into for the next Ansible version if I have time is to officially support PowerShell 7.x. This version uses a different compiler mechanism that doesn't require temporary files as the compilation happens in process. This could be the solution to this particular problem. I cannot guarantee that it'll be done in the next release though, just something that's on my mind. |
I am experimenting with Seeing that async_dir is set to The I have not rolled this out to prod just yet, so I cannot report any results on the effectiveness of fixing the errors.
Sounds interesting to have that option! (Even though I don't see us rolling out powershell 7.x to all servers in the near future) |
It's to replicate the same behaviour on the Linux side where the dir is
The actual dir isn't, the value is meant to be a location where each module would create their own temp directory inside it. The default is |
@jborean93 Unfortunately changing the temp directory did not help with this issue. If you would consider adding a retry mechanism for this, I would greatly appreciate it. |
Hello there, I'm not sure if it's the same case or could be related, but I have similar behavior 1 each approx. 100 executions:
I don't think it's related to async because It happens also on tasks without async option. (probably is more common on async tasks where there are more activities on temp folder). ANSIBLE VERSION
|
@jborean93 Any chance to get a retry mechanism added here? :-) |
SUMMARY
With ever growing host count (currently 180 ansible managed windows 2019/2022 servers), I am seeing more and more of these errors, breaking our deployment CI/CD pipeline:
I had already reported this here, in an issue with a similar problem that was successfully resolved thanks to @jborean93.
Would be great if it was possible to solve this one too.
ISSUE TYPE
COMPONENT NAME
Unsure
ANSIBLE VERSION
STEPS TO REPRODUCE
Execute any windows task on enough hosts and you will run into this.
The text was updated successfully, but these errors were encountered: