actions / checkout

Action for checking out a repo
https://github.com/features/actions
MIT License
5.74k stars 1.7k forks source link

Error: File was unable to be removed Error: EACCES: permission denied, rmdir '/opt/actions-runner/_work/... #1720

Open mihalt opened 4 months ago

mihalt commented 4 months ago

When I run checout second+ times I have error like this on the title on my ubuntu self-hosted runner. A config is very simple like

on:
  push:
    branches: [ "production", "developing" ]
  pull_request:
    branches: [ "production", "developing" ]
  workflow_dispatch:

env:
  IMAGE_NAME: ${{ github.repository }}

jobs:
  testing:
    runs-on: self-hosted

    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v4

      - uses: hoverkraft-tech/compose-action@v1.5.1
        with:
          up-flags: "--build"
      - name: testing
        run: "docker compose exec app pytest"
...

This command can help, but just once. After on the next running of job I see the same errors:

sudo chmod -R u+w /opt/actions-runner/_work/
sudo chown -R <username>:<group> /opt/actions-runner/_work/
seniordev-ca commented 2 months ago

@mihalt , any updates on this how to fix the error?

image
mihalt commented 2 months ago

@seniordev-ca Nothing better than this yet

This command can help, but just once. After on the next running of job I see the same errors:

sudo chmod -R u+w /opt/actions-runner/_work/ sudo chown -R : /opt/actions-runner/_work/

rainerh commented 1 month ago

We are facing the same issue on all GitHub managed runners since this morning.

Error: File was unable to be removed Error: EACCES: permission denied, unlink '/home/runner/work/<reponame>/<reponame>/pkg/mod/golang.org/x/telemetry/config@v0.28.0/LICENSE'

A quick workaround for us was to disable the GOPROXY before the first checkout step as described here: https://github.com/golang/go/issues/67463#issuecomment-2120473780

      - run: |
          echo "GOPROXY=off" >> $GITHUB_ENV
asei-proxima commented 1 month ago

I faced same issue. But the following code resolve this issue:

./svc.sh install root

sudo ./svc.sh start

(please uninstall existing service, first)

marissareyes80 commented 1 month ago

Y como lo hago?

El lun, 19 de ago de 2024, 1:46 a. m., Asei Inoue @.***> escribió:

I faced same issue. But the following code resolve this issue:

./svc.sh install root

— Reply to this email directly, view it on GitHub https://github.com/actions/checkout/issues/1720#issuecomment-2295884847, or unsubscribe https://github.com/notifications/unsubscribe-auth/BKA5PLXFOCH35HYFVC45573ZSGPFLAVCNFSM6AAAAABHNSK6K6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVHA4DIOBUG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pmabres commented 1 month ago

Having the same issue with Github cloud hosted runners and custom docker images using ghcr.io registry.

jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image:  ghcr.io/${{ github.repository_owner }}/MY_CUSTOM_IMAGE:main
      credentials:
        username: ${{ github.actor }}
        password: ${{ secrets.GITHUB_TOKEN }}
    steps:
    - uses: actions/checkout@v4.1.0

Is producing the following output

/usr/bin/docker exec  9c1ef0722b50a35be011c94cd4b11613abd66de932815320787efe6a556b42ec sh -c "cat /etc/*release | grep ^ID"
node:fs:2346
    return binding.writeFileUtf8(
                   ^

Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/save_state_67a1c14a-d0a9-4347-a4e9-91d95775aead'
    at Object.writeFileSync (node:fs:2346:20)
    at Object.appendFileSync (node:fs:2427:6)
    at Object.issueFileCommand (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:2967:8)
    at Object.saveState (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:2884:31)
    at 8647 (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:2343:10)
    at __nccwpck_require__ (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:[18](https://github.com/###REDACTED###/actions/runs/10448856273/job/28973868656#step:3:19)273:43)
    at 2565 (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:146:34)
    at __nccwpck_require__ (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:18273:43)
    at 9[21](https://github.com/###REDACTED###/actions/runs/10448856273/job/28973868656#step:3:22)0 (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:1144:36)
    at __nccwpck_require__ (/__w/_actions/actions/checkout/v4.1.0/dist/index.js:18273:43) {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/__w/_temp/_runner_file_commands/save_state_67a1c14a-d0a9-4347-a4e9-91d95775aead'
}
jdebbink commented 1 month ago

Also getting this issue. I'm using this workaround with some success.

- uses: actions/checkout@v4
   with:
     path: ${{ github.sha }}