-
Notifications
You must be signed in to change notification settings - Fork 174
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 "unable to delete temporary file" errors #598
Comments
Part of executing modules is to compile a helper module util that is written in C#. This C# util requires compilation and internally uses csc.exe to produce a temporary dll. The error indicated here CS1610 would indicate it failed to remove the temporary files from this operation but the cause behind it is not really seen. While I can investigate potentially turning this error into a warning there is not much we can do to solve the underlying cause as the delete part happens under a process not under our control. |
@jborean93 It would be greatly appreciated if this could be turned into a warning instead of an error. |
Just out of curiosity: it seems like this helper module compilation/deletion is done on every task. Is that really efficient? |
There are a few things that come into play with file deletion and Ansible
Controller DeletionThis happens when the controller needs to create a temporary directory for an action invocation. For example using
This also can happen if pipelining is disabled but for Windows and the Module DeletionThis happens when the module using the This IssueThis particular problem is somewhat separate from the other two types of tempdirs. When modules run a module_util that is written in C# the code needs to be compiled. Internally we essentially call something similar to the Add-Type cmdlet so the actual creation of this temporary file and trying to delete it is really outside of our control. I'll have to play around with this a bit more to see what knobs I have to control this particular failure.
We do this on every task because each task should be self contained and not leave any leftover artifacts. Outside of the controller side tempdir (which should be somewhat uncommon on Windows) managing the module side tempdir is a fairly inexpensive (and also uncommon task). |
I need to spend some more time in figuring out a good way to test it out but I hope ansible/ansible#83080 should improve the situation for you. Unfortunately the error comes from |
Thanks, that looks great! |
@jborean93 Any chance to get this merged soon? This keeps breaking large playbook runs for me. :( |
Sorry for the delay, it has been merged and backports have been created. |
@jborean93 Thank you so much! |
Hi @jborean93 I have lately been seeing a few of these (seemingly related) errors:
Do you think it would be possible to fix these as well? |
SUMMARY
In addition to the winrm connection issues discussed in #597, there is another intermittent issue that is starting to show up more often with growing host count. I would say this happens once in every 5000 task executions. It happens to all types of ansible.windows modules, so it seems to be some type of general problem with how ansible executes powershell on windows.
Here are some sample errors:
ISSUE TYPE
COMPONENT NAME
winrm
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Target OS: windows server 2022
pywinrm-0.4.3
pykerberos-1.2.4
The text was updated successfully, but these errors were encountered: