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

Non-fatal caching error with cypress/included in GitHub Actions with non-root user #1119

Open
MikeMcC399 opened this issue Jun 14, 2024 · 0 comments

Comments

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Jun 14, 2024

Issue

If cypress-io/github-action is used to run cypress/included with --user 1001 (as recommended), then GitHub actions may report a caching error

Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2

The workflow includes the following:

    container:
      image: cypress/included
      options: --user 1001

This problem does not occur the first time a workflow is run in a branch. It happens on subsequent runs when caches have been established.

The caching error does not prevent the action from successfully completing Cypress tests.

Logs

/usr/bin/tar -xf /__w/_temp/ca2a82ec-2d14-4f9f-a1e8-869a277f1c39/cache.tgz -P -C /__w/cypress-docker-images/cypress-docker-images -z
/usr/bin/tar: ../../../root/.cache/Cypress/13.11.0/Cypress/resources/app/packages/resolve-dist: Cannot utime: Operation not permitted
/usr/bin/tar: ../../../root/.cache/Cypress/13.11.0/Cypress/resources/app/packages/resolve-dist: Cannot change mode to rwxr-xr-x: Operation not permitted
/usr/bin/tar: ../../../root/.cache/Cypress/13.11.0/Cypress/resources/app/packages/net-stubbing/node_modules/mime-db: Cannot utime: Operation not permitted
/usr/bin/tar: ../../../root/.cache/Cypress/13.11.0/Cypress/resources/app/packages/net-stubbing/node_modules/mime-db: Cannot change mode to rwxr-xr-x: Operation not permitted
/usr/bin/tar: ../../../root/.cache/Cypress/13.11.0/Cypress/resources/app/packages/net-stubbing/node_modules/mime-types: Cannot utime: Operation not permitted
/usr/bin/tar: ../../../root/.cache/Cypress/13.11.0/Cypress/resources/app/packages/net-stubbing/node_modules/mime-types: Cannot change mode to rwxr-xr-x: Operation not permitted
...
...
/usr/bin/tar: ../../../root/.cache/Cypress: Cannot utime: Operation not permitted
/usr/bin/tar: ../../../root/.cache/Cypress: Cannot change mode to rwxr-xr-x: Operation not permitted
/usr/bin/tar: Exiting with failure status due to previous errors
Warning: Failed to restore: "/usr/bin/tar" failed with error: The process '/usr/bin/tar' failed with exit code 2

Workaround

Set the environment variable CYPRESS_INSTALL_BINARY=0 to avoid unnecessary caching of the Cypress binary. For instance:

  docker-included:
    runs-on: ubuntu-22.04
    container:
      image: cypress/included
      options: --user 1001
    steps:
      - uses: actions/checkout@v4
      - uses: cypress-io/github-action@v6
        env:
          CYPRESS_INSTALL_BINARY: 0

This setting should be added to the documentation.

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

No branches or pull requests

1 participant