Skip to content
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

Checkout V3 fails in self-hosted runner on ubuntu VM with git permissions #1552

Open
stan-spotts opened this issue Nov 21, 2023 · 2 comments

Comments

@stan-spotts
Copy link

Brand new VM set up and having this issue on checkout action. Log shows this:

Run actions/checkout@v3
  with:
    submodules: true
    lfs: false
    repository: MyOrg/MyRepo
    token: ***
    ssh-strict: true
    persist-credentials: true
    clean: true
    sparse-checkout-cone-mode: true
    fetch-depth: 1
    fetch-tags: false
    set-safe-directory: true
  env:
    NPM_CONFIG_LEGACY_PEER_DEPS: true
Syncing repository: MyOrg/MyRepo
Getting Git version info
  Working directory is '/home/githubrunner/actions-runner/_work/myrepo/myrepo'
  /usr/bin/git version
  git version [2](https://github.com/MyOrg/MyRepo/actions/runs/6945216503/job/18894061759#step:3:2).25.1
Temporarily overriding HOME='/home/githubrunner/actions-runner/_work/_temp/[3](https://github.com/MyOrg/MyRepo/actions/runs/6945216503/job/18894061759#step:3:3)f99179c-5928-[4](https://github.com/MyOrg/MyRepo/actions/runs/6945216503/job/18894061759#step:3:4)117-ad82-[5](https://github.com/MyOrg/MyRepo/actions/runs/6945216503/job/18894061759#step:3:5)1[8](https://github.com/MyOrg/MyRepo/actions/runs/6945216503/job/18894061759#step:3:8)322f[9](https://github.com/MyOrg/MyRepo/actions/runs/6945216503/job/18894061759#step:3:9)bca1' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/githubrunner/actions-runner/_work/MyRepo/MyRepo
/usr/bin/git config --local --get remote.origin.url
https://github.com/MyOrg/MyRepo
Removing previously created refs, to avoid conflicts
  /usr/bin/git rev-parse --symbolic-full-name --verify --quiet HEAD
  refs/heads/development
  /usr/bin/git checkout --detach
  Error: fatal: Unable to create '/home/githubrunner/actions-runner/_work/MyRepo/MyRepo/.git/index.lock': Permission denied
  Warning: Unable to prepare the existing repository. The repository will be recreated instead.
  Deleting the contents of '/home/githubrunner/actions-runner/_work/MyRepo/MyRepo'
  Error: File was unable to be removed Error: EACCES: permission denied, unlink '/home/githubrunner/actions-runner/_work/MyRepo/MyRepo/.eslintrc.cjs'

looking in the _work/MyRepo/MyRepo folder, all is owned by root (thought it would be by githubrunner account).

drwxrwxr-x   8 root         root            4096 Nov 21 14:24 .
drwxrwxr-x   3 githubrunner githubrunner    4096 Nov 21 14:23 ..
-rw-rw-r--   1 root         root             519 Nov 21 14:23 .eslintrc.cjs
drwxrwxr-x   8 root         root            4096 Nov 21 14:23 .git
drwxrwxr-x   3 root         root            4096 Nov 21 14:23 .github
-rw-rw-r--   1 root         root             253 Nov 21 14:23 .gitignore
-rw-rw-r--   1 root         root              17 Nov 21 14:23 README.md
-rw-rw-r--   1 root         root         2024283 Nov 21 14:23 dashboard-img.svg
drwxr-xr-x   3 root         root            4096 Nov 21 14:24 dist
-rw-rw-r--   1 root         root             970 Nov 21 14:23 index.html
drwxr-xr-x 225 root         root           12288 Nov 21 14:23 node_modules
-rw-rw-r--   1 root         root          159166 Nov 21 14:23 package-lock.json
-rw-rw-r--   1 root         root            1600 Nov 21 14:23 package.json
drwxrwxr-x   2 root         root            4096 Nov 21 14:23 public
drwxrwxr-x  11 root         root            4096 Nov 21 14:23 src
-rw-rw-r--   1 root         root             670 Nov 21 14:23 tsconfig.json
-rw-rw-r--   1 root         root             213 Nov 21 14:23 tsconfig.node.json
-rw-rw-r--   1 root         root             439 Nov 21 14:23 vite.config.ts

Is there some additional group setting or permissions needed somewhere prior to executing a workflow for checkout action to properly function?

@germa89
Copy link

germa89 commented Nov 29, 2023

Probably related to: #1014

@fredriknilson
Copy link

I am using v4 and have the same problem. I'm running my self-hosted runner on Debian 12. If I delete the directory it works again, but will fail next time.

Run actions/checkout@v4
  with:
    lfs: true
    repository: ***/***
    token: ***
    ssh-strict: true
    persist-credentials: true
    clean: true
    sparse-checkout-cone-mode: true
    fetch-depth: 1
    fetch-tags: false
    show-progress: true
    submodules: false
    set-safe-directory: true
  env:
    ***
  
Syncing repository: ***/***
Getting Git version info
  Working directory is '/***/actions-runner/_work/***/***'
  /usr/bin/git version
  git version 2.34.1
  /usr/bin/git lfs version
  git-lfs/3.0.2 (GitHub; linux amd64; go 1.18.1)
Temporarily overriding HOME='/***/actions-runner/_work/_temp/40a049fd-b807-4e2a-a400-f57595fe1f53' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /***/actions-runner/_work/***/***
/usr/bin/git config --local --get remote.origin.url
https://github.com/***/***
Removing previously created refs, to avoid conflicts
  /usr/bin/git rev-parse --symbolic-full-name --verify --quiet HEAD
  refs/heads/githubactions
  /usr/bin/git checkout --detach
  Error: fatal: Unable to create '/***/actions-runner/_work/***/***/.git/index.lock': Permission denied
  Warning: Unable to prepare the existing repository. The repository will be recreated instead.
  Deleting the contents of '/***/actions-runner/_work/***/***'
  Error: File was unable to be removed Error: EACCES: permission denied, unlink '/***/actions-runner/_work/***/***/.git/FETCH_HEAD'
  total 68
drwxr-xr-x  6 github-runner github-runner 4096 Dec  4 14:48 .
drwxr-xr-x  3 github-runner github-runner 4096 Dec  4 14:47 ..
drwxr-xr-x 19 root          root          4096 Dec  4 14:48 ***
-rw-r--r--  1 root          root           350 Dec  4 14:48 ***
-rw-r--r--  1 root          root           864 Dec  4 14:48 ***
-rw-r--r--  1 root          root          4718 Dec  4 14:48 ***
drwxr-xr-x  5 root          root          4096 Dec  5 07:59 ***
drwxr-xr-x  8 root          root          4096 Dec  5 08:00 ***
-rw-r--r--  1 root          root           202 Dec  4 14:48 ***
drwxr-xr-x  3 root          root          4096 Dec  4 14:48 ***
-rw-r--r--  1 root          root          9751 Dec  4 14:48 ***
-rwxr-xr-x  1 root          root            72 Dec  4 14:48 ***
-rwxr-xr-x  1 root          root           458 Dec  4 14:48 ***
-rw-r--r--  1 root          root           373 Dec  4 14:48 ***
-rw-r--r--  1 root          root             0 Dec  4 14:48 ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants