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

The Cypress App could not be unzipped when using github action #618

Closed
chelshaw opened this issue Nov 1, 2022 · 4 comments
Closed

The Cypress App could not be unzipped when using github action #618

chelshaw opened this issue Nov 1, 2022 · 4 comments

Comments

@chelshaw
Copy link

chelshaw commented Nov 1, 2022

My action is as follows:

name: CI
on: push
jobs:
  e2e:
    name: End-to-end
    runs-on: ubuntu-latest
    container: cypress/included:10.11.0

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Cypress run
        uses: cypress-io/github-action@v4
        with:
          build: npm run build:emulator
          start: npm run start:emulator
        env:
          ...

I get the following error on the Cypress run step:

/usr/bin/docker exec  6e4516bcecc675ae610ccf016dec6495663db5841bc7bdfb59dd6c38bc66988c sh -c "cat /etc/*release | grep ^ID"
/usr/local/bin/npm ci
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /__w/deep-transparency-site/deep-transparency-site/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install
npm ERR! [STARTED] Task without title.
npm ERR! [SUCCESS] Task without title.
npm ERR! [STARTED] Task without title.
npm ERR! The Cypress App could not be unzipped.
npm ERR! 
npm ERR! Search for an existing issue or open a GitHub issue at
npm ERR! 
npm ERR! https://github.com/cypress-io/cypress/issues
npm ERR! 
npm ERR! ----------
npm ERR! 
npm ERR! Error: EACCES: permission denied, mkdir '/root/.cache/Cypress/10.8.0'
npm ERR! 
npm ERR! ----------
npm ERR! 
npm ERR! Platform: linux-x64 (Debian - 11.4)
npm ERR! Cypress Version: 10.8.0
npm ERR! [FAILED] The Cypress App could not be unzipped.
npm ERR! [FAILED] 
npm ERR! [FAILED] Search for an existing issue or open a GitHub issue at
npm ERR! [FAILED] 
npm ERR! [FAILED] https://github.com/cypress-io/cypress/issues
npm ERR! [FAILED] 
npm ERR! [FAILED] ----------
npm ERR! [FAILED] 
npm ERR! [FAILED] Error: EACCES: permission denied, mkdir '/root/.cache/Cypress/10.8.0'
npm ERR! [FAILED] 
npm ERR! [FAILED] ----------
npm ERR! [FAILED] 
npm ERR! [FAILED] Platform: linux-x64 (Debian - 11.4)
npm ERR! [FAILED] Cypress Version: 10.8.0
@thampton
Copy link

Ran into the same problem you are reporting here. The issue isn't with this action specifically but a combination of how GitHub actions work, this action, and the container you are using. Specifically the issue is with the default user that github actions use inside the container, what permissions this action needs, and the users that are exist on the container and there permissions.

references:

  1. https://github.com/cypress-io/cypress-realworld-app/blob/develop/.github/workflows/main.yml#L75
  2. https://github.com/cypress-io/cypress-docker-images/blob/master/factory/installScripts/cypress/default.sh#L13.
  3. Experiencing permission denied after v3.1.0 on jobContainers when container user is not 'root' actions/checkout#956

@thampton
Copy link

See #963

@MikeMcC399
Copy link
Collaborator

@thampton

I was unable to reproduce the issue from the original post using a workflow based on cypress/included:10.11.0, actions/checkout@v2 and cypress-io/github-action@v4 listed in the issue, then running the workflow on a GitHub-hosted runner.

I also did not see any problem when I ran the workflow again using current versions cypress/included:12.17.1, actions/checkout@v3 and cypress-io/github-action@v5.

Since I can't reproduce the issue, I don't have any explanation for the error message. There have been changes made by GitHub and in the way that Cypress Docker images are built since this problem was originally reported.

According to your comments I understand that you are currently seeing this issue, so could you please say which Docker image you used, post your workflow together with your log file and say if you are running on a GitHub-hosted or self-hosted runner? We can take a look to see if it is generally reproducible.

You could also add a step to your workflow to see what user is involved in your case.
run: id
I see the following as default
uid=0(root) gid=0(root) groups=0(root)

It is more of a topic for the cypress-io/cypress-docker-images Issues list but let's continue here until we get a better understanding of the root cause and under what circumstances the error appears.


The original post showed the use of a Docker image from the cypress/included set of images, which includes a specified installed version of Cypress corresponding to the tag of the image (10.11.0 for cypress@10.11.0). The error log however shows an attempted installation of cypress@10.8.0 so it seems that there was a lock file which specified an earlier version of Cypress than the one included in the Docker image.

Normally if the repo's package.json and lock file include a certain version of Cypress, then it would be more appropriate to use a Docker image from the cypress/browsers set of images, which include all browsers and prerequisites for Cypress, but not Cypress itself.

@nagash77 nagash77 self-assigned this Jul 18, 2023
@nagash77
Copy link
Contributor

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

@nagash77 nagash77 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2023
@nagash77 nagash77 removed their assignment Jul 27, 2023
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

4 participants