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
The directory '/github/home/.cache/pip' or its parent directory is not owned or is not writable by the current user #816
Comments
Hello @kostrykin |
I see this error as well with a GH runner and setup-python@v5.
|
One of the classical issues with self-hosted runners. This BTW happens for any tool installation that happens inside a container, as the tool is saved in the toolcache by the container user (as the action is executed inside the container by the nodejs mounted at If container use is a requirement, prefer container's native package management or even better use directly If you are using self-hosted runners to run containerized jobs that install things using js actions, the only solution I found is to add a cron in the runner VM to PS out-of-topic: IMHO self-hosted runners are a painful mess of technical debt. I suggest to add daily crons for:
But -spoiler- this is only a start, be ready to modify your preferred checkout action with a $HOME override if inside a container. |
Hello @kostrykin, We have investigated the issue and found that the error occurs when the current user doesn't have write permissions to the specified directory. In the context of docker, this issue is related to how the container is set up and the user that the container is running as. The root cause of the issue could be related to how the container and user are set up. If the issue persists, we might need to look into configuring the docker container to run as a specific user that has the necessary permissions.
This will change the ownership of the /github/home directory to the current user, which should resolve the permission issue when setup-python tries to use the /github/home/.cache/pip directory. |
Description:
I'm trying to use the setup-python action using a freshly setup self-hosted runner and a container image:
This leads to the following docker invocation:
In the next step, the setup-python action yields the error:
When I create the docker container using the command cited above manually, I can inspect the directory
/github/home
:root@a7617501a8b5:/__w/SuperDSM/SuperDSM# ls -al /github/home total 12 drwxr-xr-x 2 1002 1003 4096 Feb 14 16:20 . drwxr-xr-x 4 root root 4096 Feb 14 16:21 .. -rw------- 1 root root 71 Feb 14 16:20 .bash_history
Touching/removing the contents of
/github/home
also works just fine, so there seems to be no permission issue.The runner is running wird UID 1002 and GID 1003.
Running the action without a container results in a different error (
mkdir: cannot create directory ‘/Python’
) which I think is because it attempts to modify the host root filesystem, for which the user with UID 1002 lacks permissions (which is intended).Action version: 5
Platform:
Runner type:
Tools version:
3.8.x
Full log of the action:
The text was updated successfully, but these errors were encountered: