[BUG] clean up routine tries to delete file with shutil.rmtree #60170
Labels
Bug
broken, incorrect, or confusing behavior
effort-small
level of effort estimated in size
enhancement
enhancing, extending functionality, not refactor or net new
Phosphorus v3005.0
Release code name and version
severity-high
2nd top severity, seen by most users, causes major problems
Milestone
Description
First of all, thank you for your work on this projet! We are using it for years now and are very happy with it! I would like to bring to your attention an issue we are experiencing recently though. Similarly to this issue, the clean up routine fails to clear the master's job cache, leading to all the inodes of the system being used. The bug itself is that the clean up routine tries to delete a file with
shutil.rmtree
The path in question points to a file, not a directory
Using
os.path.isdir
instead ofos.path.exists
insalt/salt/returners/local_cache.py
Line 442 in 5dfb901
f_path
is a file could fix the problem, but I didn't really have time to test this.Setup
I'm not sure any of the config files are relevant here - if you need any, I'm happy to provide them.
Steps to Reproduce the behavior
We experienced a pretty bad hardware crash some days before, so that it is entirely possible that the file system is just in a weird state, and that normally these files would be directories.
Steps I have taken so far
Stopped and restarted salt-master. I also deleted some of the files by hand to clear up some inodes.
Expected behavior
I don't know what would be appropriate behaviour. I guess removing the files with a warning in the logs?
Versions Report
salt --versions-report
Additional context
As mentioned beforehand, the file system is probably in an unstable state. My solution in the meantime will be to remove any files in
/var/cache/salt/master/jobs/
and monitor the situation to see if it is a recurring problem.Thank you for your time!
The text was updated successfully, but these errors were encountered: