upload-artifact icon indicating copy to clipboard operation
upload-artifact copied to clipboard

[bug] Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/set_output

Open EvanCarroll opened this issue 1 year ago • 7 comments

What happened?

I'm getting this error

Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/set_output_d2205233-0bbe-4051-bbc9-e5172c1bd80c'

With this stanza

      - name: Upload Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: openapi-dist
          path: /home/redocly/redocly-build/dist/
          overwrite: true

Full log:

Run actions/upload-artifact@v4
/usr/bin/docker exec  2da4b0ca19a4ab8bcdfa7a4e666de0f7084a1ffd15a57aede7024828a3d136f4 sh -c "cat /etc/*release | grep ^ID"
With the provided path, there will be [12](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11694984758/job/32569637796#step:5:13) files uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 3405497
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is 77a15ed64[13](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11694984758/job/32569637796#step:5:14)9d3613f0dd23ee751fcf01c3cceee7b6c25986258f65720a68185
Finalizing artifact upload
Artifact openapi-dist.zip successfully finalized. Artifact ID 2[14](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11694984758/job/32569637796#step:5:15)9821923
Artifact openapi-dist has been successfully uploaded! Final size is 3405497 bytes. Artifact ID is 2149821923
Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/set_output_d2205233-0bbe-4051-bbc9-e5[17](https://github.com/webpros-cpanel/wp2-openapi/actions/runs/11694984758/job/32569637796#step:5:18)2c1bd80c'

What did you expect to happen?

I expected it to work.

How can we reproduce it?

Conditions are above. Not sure if anything else is required.

Anything else we need to know?

No response

What version of the action are you using?

v4

What are your runner environments?

linux

Are you on GitHub Enterprise Server? If so, what version?

No response

EvanCarroll avatar Nov 06 '24 00:11 EvanCarroll

This sounds like a duplicate of this bug https://github.com/actions/upload-artifact/issues/542

But is this serious, you don't support containers running non-root processes?

EvanCarroll avatar Nov 06 '24 01:11 EvanCarroll

As reported elsewhere, this is bizarre to me, works fine with @V3. This needs to be fixed in V4. What a huge regression.

Starting artifact upload
For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
Artifact name is valid!
Container for artifact "openapi-dist" successfully created. Starting upload of file(s)
Total size of all the files uploaded is 3404298 bytes
File upload process has finished. Finalizing the artifact upload
Artifact has been finalized. All files have been successfully uploaded!

The raw size of all the files that were specified for upload is 37053942 bytes
The size of all the files that were uploaded is 3404298 bytes. This takes into account any gzip compression used to reduce the upload size, time and storage

Note: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads 

Artifact openapi-dist has been successfully uploaded!

EvanCarroll avatar Nov 06 '24 01:11 EvanCarroll

We are also using V3 due to this bug. Hopefully it won't break even though it's deprecated because this needs to be fixed in V4. At least respond to this issue in some way.

joakimk avatar Jan 29 '25 13:01 joakimk

I've also encountered this issue.

Usage:

  run-tests:
    needs: [build-and-deploy, setup-cypress]
    runs-on: ${{ github.event.inputs.runner }}
    container:
      image: cypress/included:13.17.0
      options: --add-host=host.docker.internal:host-gateway
      volumes:
        - ${{ github.workspace }}/tests-cy:/srv/tests-cy
        - ${{ github.workspace }}/tests-cy/package.json:/srv/package.json
      env:
        HOME: /root
        DBUS_SESSION_BUS_ADDRESS: /dev/null
        DBUS_SYSTEM_BUS_ADDRESS: /dev/null

    steps:
      - name: Setup NPM environment
        run: |
          mkdir -p /srv/.npm
          npm config set cache /srv/.npm --global
          npm config set prefix /srv/.npm --global

      - name: Create screenshots directory
        run: |
          mkdir -p /srv/screenshot
          chmod 777 /srv/screenshot

      - name: Install dependencies
        working-directory: /srv
        env:
          HOME: /srv
          npm_config_cache: /srv/.npm
        run: npm i

      - name: Execute Cypress tests
        working-directory: /srv/tests-cy
        env:
          HOME: /root
        run: cypress run --browser chrome
        continue-on-error: true

      - name: Upload test artifacts
        uses: actions/upload-artifact@v4
        with:
          name: cypress-screenshots
          path: /srv/screenshot/*
          if-no-files-found: warn

Logs:

/usr/bin/docker exec  bcbf0885aa8a881d335137d4fd64a9d91af81185f3bce23dd3c767051ee8b2eb sh -c "cat /etc/*release | grep ^ID"
With the provided path, there will be 8 files uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 973869
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is 43276db39ed22d885c980f269d66e3dfc93d315541b6d798f055b0bda7e9979b
Finalizing artifact upload
Artifact cypress-screenshots.zip successfully finalized. Artifact ID 2563192312
Artifact cypress-screenshots has been successfully uploaded! Final size is 973869 bytes. Artifact ID is 2563192312
Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/set_output_f450d1d6-a814-4436-b406-4860aab25da2'

The artifacts ( in my case screenshots from cypress ) get uploaded fine, so i don't even know what causes the error.

But this error just does not occur with upload-artifact v3 for me. It would be nice if this got adressed.

dolores-dei avatar Feb 10 '25 09:02 dolores-dei

I was able to overcome this issue by adding options: --user root to the container section.

nemdub avatar Feb 10 '25 10:02 nemdub

I was able to overcome this issue by adding options: --user root to the container section.

I've tried it and it doesn't solve the error for me - it still appears.

dolores-dei avatar Feb 10 '25 11:02 dolores-dei

I also have this problem, and we can't even use v3 since 30th January 2025 anymore this really needs to be adressed.

ivo-ruzicka-neit avatar Feb 10 '25 11:02 ivo-ruzicka-neit

Hitting this issue as well. I'll see if the --user root workaround will work for the container.

cfriedt avatar May 22 '25 16:05 cfriedt