Fix tmpdirs not being removed in Dolos API #1413
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've had some issues with the
/tmp
directory filling up with the result files that were not removed at the end of an analysis, ultimately filling up the storage space (and causing Dolos to give 500 errors).This was caused by dolos running as
root
in the container. The files that were created during the analysis could therefore not be removed by the webserver because it did not have the correct permissions. The error was hidden by another bug where the argumentverbose: true
to the methodremove_entry_safe
, which was actually interpreted asforce = true
which ignores errors.This PR changes the default user of the Dolos docker container to
node
and sets the container uid to that matching the current user running the webserver. The resulting files should be owned by the current user and should be removed again.I have pushed this change with
ghcr.io/dodona-edu/dolos:2.5.1-1
to let the CI succeed.