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

Error: EACCES: permission denied, stat '/root/.cache/Cypress/9.2.0/Cypress/Cypress' #19457

Closed
tsaint31 opened this issue Dec 22, 2021 · 6 comments
Labels
stage: needs information Not enough info to reproduce the issue

Comments

@tsaint31
Copy link

tsaint31 commented Dec 22, 2021

Current behavior

when i run in a docker container
npm run cy:run:git:stg
i got the error:

"An unexpected error occurred while verifying the Cypress executable.
Please search Cypress documentation for possible solutions:
https://on.cypress.io
Check if there is a GitHub issue describing this crash:
https://github.com/cypress-io/cypress/issues
Consider opening a new issue.
----------
Error: EACCES: permission denied, stat '/root/.cache/Cypress/9.2.0/Cypress/Cypress'
----------
Platform: linux-x64 (Debian - 11.2)
Cypress Version: 9.2.0
Error: Process completed with exit code 1."

I do not understand why i got this error as i launch the command as root and the permission on the directory are OK

drwxr-xr-x 5 root root      4096 Dec 22 17:46 .
drwxr-xr-x 3 root root      4096 Dec 22 17:45 ..
-rwxr-xr-x 1 root root 146347320 Dec 22 17:46 Cypress

Desired behavior

cypress should start as usual

Test code to reproduce

the command in the package json is

    "cy:run:git:stg": "cypress run --config baseUrl=http://localhost:8080 --env apiUrl=https://api... --spec 'cypress/integration/critical/*'",

Cypress Version

9.2.0

Other

No response

@emilyrohrbough
Copy link
Member

@tsaint31 Can you please provide the full error message?

@tsaint31
Copy link
Author

this is the error i receive in github action
"An unexpected error occurred while verifying the Cypress executable.
Please search Cypress documentation for possible solutions:
https://on.cypress.io
Check if there is a GitHub issue describing this crash:
https://github.com/cypress-io/cypress/issues
Consider opening a new issue.

Error: EACCES: permission denied, stat '/root/.cache/Cypress/9.2.0/Cypress/Cypress'

Platform: linux-x64 (Debian - 11.2)
Cypress Version: 9.2.0
Error: Process completed with exit code 1."

@mjhenkes mjhenkes added the stage: needs information Not enough info to reproduce the issue label Jan 3, 2022
@mjhenkes
Copy link
Member

mjhenkes commented Jan 3, 2022

@tsaint31 are you running cypress in a cypress provided docker file? If so which are you using? If not how are you building out your docker file? Since this is failing due to access in a docker container it seems like we could get a reproducible example together.

@mjhenkes
Copy link
Member

mjhenkes commented Jan 3, 2022

This issue may be related: cypress-io/github-action#446

Try this work around: cypress-io/github-action#446 (comment)

@tsaint31
Copy link
Author

tsaint31 commented Jan 4, 2022

We found the answer to our problem do not know really why but it solve the point.
When we run our docker we run with option -v to Bind mount a volume
docker run -v "$(pwd):/usr/src/app" -v "/usr/src/app/node_modules" -d --name=$CONTAINER_NAME image-test
by just launching
docker run -d --name=$CONTAINER_NAME image-test
it solve the problem

@secondW4ve
Copy link

secondW4ve commented Aug 1, 2022

We found the answer to our problem do not know really why but it solve the point. When we run our docker we run with option -v to Bind mount a volume docker run -v "$(pwd):/usr/src/app" -v "/usr/src/app/node_modules" -d --name=$CONTAINER_NAME image-test by just launching docker run -d --name=$CONTAINER_NAME image-test it solve the problem

I have the same problem but a little bit different case. I run inside one docker container node.js server that runs cypress tests, when it receives request, by running cli commands. And if I create any volume for such a container I experience this problem, even if volume has no relation to the Cypress part.

My dockerfile:

FROM node:16.13.1-alpine3.13 as server

WORKDIR /app
COPY ./server/package*.json ./
RUN npm install
COPY ./server .

FROM cypress/base:16.13.0
WORKDIR /
COPY --from=server /app /server
COPY ./CypressAutomation /CypressAutomation
WORKDIR /CypressAutomation
RUN npm install
RUN $(npm bin)/cypress install
RUN $(npm bin)/cypress verify

My docker compose file:

version: '3.7'

services:
  server:
    container_name: server
    build:
      context: .
      dockerfile: dev.Dockerfile
    logging:
      options:
        max-size: 10m
    working_dir: /server
    command: npm run start:dev
    environment:
      - ENV=${env}
    volumes:
      - ./server:/server:delegated
    ports:
      - 8080:8080

Error message

An unexpected error occurred while verifying the Cypress executable.

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

----------

Error: EACCES: permission denied, stat '/root/.cache/Cypress/9.7.0/Cypress/Cypress'

----------

Platform: linux-x64 (Debian - 10.11)
Cypress Version: 9.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue
Projects
None yet
Development

No branches or pull requests

4 participants