Skip to content

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

@stan-spotts

Description

@stan-spotts

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions