cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.66k stars 3.16k forks source link

An unexpected error occurred while verifying the Cypress executable. #29884

Open svankireddy-mdsol opened 1 month ago

svankireddy-mdsol commented 1 month ago

Current behavior

Failing to run github actions and verifying cypress fails

Desired behavior

Image used: image: cypress/browsers:node18.12.0-chrome106-ff106 It wil allow to execute: Run npx cypress info without any issues

Test code to reproduce

Github actions:

Image used: image: cypress/browsers:node18.12.0-chrome106-ff106

Cypress Version

12.17.4

Node version

18.12.0

Operating System

linux-x64 (Debian - [11])

Debug Logs

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: spawn /github/home/.cache/Cypress/12.17.4/Cypress/Cypress ENOENT
----------
Platform: linux-x64 (Debian - [11])
Cypress Version: 12.17.4
Error: Process completed with exit code 1.

Other

NA

MikeMcC399 commented 1 month ago

@svankireddy-mdsol

The Cypress Docker image cypress/browsers:node18.12.0-chrome106-ff106 you are using was published in November 2022. To use this image in GitHub Actions make sure that you run it with user 1001. This is recommended for all Cypress Docker images.

    container:
      image: cypress/browsers:node18.12.0-chrome106-ff106
      options: --user 1001

You can find an example workflow on .github/workflows/example-cypress-github-action.yml in the Cypress Docker image repository.

You may also want to consider updating to an equivalent current image, such as

cypress/browsers:node-18.20.3-chrome-125.0.6422.141-1-ff-126.0.1-edge-125.0.2535.85-1

which was published in June 2024. Older images are frozen and corrections are made by publishing a newer image.

If the above does not solve your issue, then please post your full GitHub Actions workflow.

MikeMcC399 commented 1 month ago

The original Docker file was https://github.com/cypress-io/cypress-docker-images/blob/b70e17873b70eebb9e67cd3faf7312b12ad5225d/browsers/node18.12.0-chrome106-ff106/Dockerfile

Current builds use https://github.com/cypress-io/cypress-docker-images/blob/master/factory/factory.Dockerfile which relaxes the permissions to chmod 777 /root

We've added the documentation section https://github.com/cypress-io/cypress-docker-images/blob/master/README.md#user to make it clear about the need to set --user 1001 for GitHub Actions.

MikeMcC399 commented 1 month ago

@svankireddy-mdsol

Did the previous comments help resolve your issue?

svankireddy-mdsol commented 1 month ago

yes it worked but having issues with curl command - I just need to install curl