-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Error: Command failed: rm -rf "/home/runners/runner-1/_work/REPO/REPO/.mypy_cache" #1869
Comments
I unfortunately do not have access to my own GitHub runners :/ Please can you try to add in your .mega-linter.yml: PYTHON_MYPY_ARGUMENTS:
- "--no-incremental" It should prevent mypy cache to be created |
We ran into the same issue and created ScribeMD/rootless-docker for this purpose. Simply run that action before running MegaLinter, and MegaLinter will not run as root at all. |
Thanks for the suggestion. Unfortunately, the action you suggested is a resolute NO for us, because it seems to be stopping the docker daemon entirely, which is unacceptable to us as the build machine(s) have running containers for other purposes ://
Thank you, I'll let you know what happens tmrw! 😄 |
Ah, yeah, ScribeMD/rootless-docker would need to be run before anything that uses Docker, so if you have long-lived processes that rely on the daemon, that would mean restarting them one time. Fingers crossed that disabling mypy caching resolves your issue. |
I encountered something similar the other weekend, when I ran megalinter locally, but forgot so save a Python file when starting it. So I saved during the run, but after a first linter changed the contents. When wanting to save after that, it wasn't possible, it was owned by root then. I saw that the megalinter-reports files (logs at least) were also own by root. I had to For the 4 files that changed owner to root, that were code, I had to Since it was Python, yes there is still mypy involved, but it don't see why it should be limited to mypy if the folder is mounted in the Docker container when editing the files (applying fixes) |
@nvuillam It's quite easy to set up, if you have a machine, VM, or something to run the GitHub runner application. I managed to set up a self hosted windows Docker container (running Windows not Linux) for a WPF project. Running inside Docker is doable. If it's for debugging this issue (files writing as root, not deleting the folder correctly), maybe a VM is a good idea to not delete the bad thing, and to not add some error sources with a Docker in Docker setup. The environnement must be able to run the runner (https://github.com/actions/runner), and we register it to either the repo or organization |
I'm sure it's easy... at work i setup gitlab runners because I need them, but unfortunately I don't have the time to setup all configurations of all MegaLinter users to reproduce bugs... that's why having such a great community to help is great :) |
@echoix, yes, there are often multiple file ownership issues related to running Docker as root. For those who are unable to use rootless Docker and whose issues extend beyond mypy caching, maintaining a list of files to |
@nvuillam It works! mypy cache was successfully disabled. 😄 however the job failed with another error:
So I went in a bit of an adventure in solving this I discovered setting
which was kinda expected What finally worked was For completion, the portion of config relevant for this is: # .mega-linter.yaml
PYTHON_MYPY_ARGUMENTS:
- "--no-incremental"
REPORT_OUTPUT_FOLDER: /tmp |
REPORT_OUTPUT_FOLDER=none should indeed create nothing, this is a MegaLinter bug ^^ Glad you found a workaround :) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
Is it necessary for MegaLinter to run as root (for certain linters)? If not, can we change
|
There are hardcoded /root/ in dockerfile path, do sure it won't work if we just change the user (inheritance from super-linter) But maybe something can be done... would u like to try a PR? :) |
Describe the bug
We use self-hosted github runners and it seems megalinter writes on filesystem as root, making future runs impossible. When a github runner tries to delete the old repo to clone a new one, it failes with the error message:
Error: Command failed: rm -rf "/home/runners/runner-1/_work/REPO/REPO/.mypy_cache"
To Reproduce
root
permissionsExpected behavior
Megalinter should either clean those files up, or it shouldn't be writing those files with root permissions.
Screenshots
[ not provided due to the company policy ]
The text was updated successfully, but these errors were encountered: