-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: EACCES: permission denied in container on self hosted Linux runner #1014
Comments
I'm getting this same error on GitHub-hosted runners, in the container
I'm invoking the action as runs-on: ubuntu-latest
container:
image: docker.io/homebrew/ubuntu22.04
steps:
- uses: actions/checkout@v3
name: Clone this repository |
Looks like #956 is related... |
I think #956 has workarounds, so I think this issue can be closed. The workaround that I used was to "override the default container user and use 'root'": container:
image: alpine:latest
options: --user root |
Thanks for the workaround. https://github.com/junaruga/ruby/actions/runs/4175636293/jobs/7230829664
As an behavior of the software is a bit different between root and regular users, I still want to run the container by a regular user. |
You can override the default container user using options: --user root |
Yes, that's what I am doing it now. But ideally, I want to run the unit tests in the container by a regular user. Because there is a bit of difference between running the program by a regular user and the root user in my case. |
Adding my 2 cents as well, we want to specifically not run as root so the workaround doesn't work in our case. We figured any other way around this? |
Due to this [1] it seems impossible to run the container as an unprivileged user, so we override with root. [1] actions/checkout#1014
Due to this [1] it seems impossible to run the container as an unprivileged user, so we override with root. [1] actions/checkout#1014
Due to this [1] it seems impossible to run the container as an unprivileged user, so we override with root. [1] actions/checkout#1014
Due to this [1] it seems impossible to run the container as an unprivileged user, so we override with root. [1] actions/checkout#1014
I have my own workaround - nonroot: # add to dockerfile |
* Fix: override `WORKDIR` command * Patch: disabled if condition for testing * Patch: disable preceding workflow * Patch: add verbose option to check path * Patch: use `root` user according to actions/checkout#1014 * Patch: add a `chown` step to take ownership According to actions/checkout#211 * Patch: removed `sudo` as it's not found * Patch: add a `path` parameter? * Patch: try changing pwd * Patch: add `ls` to check what's happening * Patch: replace `--local` using `--global` * Patch: fix dubious ownership * Patch: trying to fix detached HEAD * Revert "Patch: disable preceding workflow" This reverts commit 2d1c778. * Revert "Patch: add verbose option to check path" This reverts commit 86d5211. * Revert "Patch: disabled if condition for testing" This reverts commit 83d4c4a. * Patch: remove `--dry-run` in deploy step * Patch: trying to remove `chown` step
+1 |
Today GitHub only supports root users on the container, so we likely will only get workarounds unless/until that changes. |
anyone has a working workaround? |
Facing same issue on Ubuntu 22.04 LTS |
I got rid of the I did create the directory using sudo, and then change the permisions and ownership using I hope it is useful for someone. This is also related to #1552 |
I get this when using a larger runner as well (following https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/running-jobs-on-larger-runners) |
This is needed to solve this bug [1]. [1] actions/checkout#1014
This is needed to solve this bug [1]. [1] actions/checkout#1014
I have a self hosted actions-runner on Ubuntu 20.04. It runs without sudo. It was having this problem. Adding this "cleanup old checkout" step is working for me.
|
The easiest way to workaround this is to go back to actions/upload-artifact@v2 not ideal although but it works |
Post job cleanup. |
p |
1 similar comment
p |
Hi all, I am not sure if this is still a valid place to comment, but I got similar errors and I want to give you some feedback and workaround. The initial idea is to not use root, so we wanted The solution mentioned earlier Runner version Another hint I need to give: Github still suggests to use root. Anyways, this is the workaround for
This made it work. The cleanup step was not throwing access errors anymore. I wish that Github would fix the access to the host folders that are anyways used inside the container... Best regards |
This (in theory) will allow running GHA in container, without root see actions/checkout#1014
This commit modifies the upload job in the `build.yaml` GitHub Action to temporarily run as root. This change addresses permission issues caused by a bug in GitHub's runner selection process (see actions/checkout#1014).
Just to add, A better solution would be great. |
In my case the following rootless setup is working: I setup a arc-runner-scale-set on "Ubuntu 22.04.5 LTS" The values when installing the scale-set are:
And my Docker image is using a 1001 user. Note: I didn't see on the scale-set config how to force the user ID to another one, 1001 seems to be the ID a static configuration. |
In an effort to checkout a repo within a container that's being self hosted on a Linux VM running Ubuntu 20.04 as follows:
With the image Docker file defined as:
I get the following error:
The text was updated successfully, but these errors were encountered: