cypress-io / cypress

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

Network issues downloading "Cypress App" fail with generic `AggregateError` #30233

Open guillermoz-nutanix opened 1 month ago

guillermoz-nutanix commented 1 month ago

Current behavior

When installing with npm ci, the command intermittently fails with a generic AggregateError, such error does not allow to discern if the issue is on the client (npm) or the server. I cannot tell from those details if the download failed midway or if it even started.

Debug logs

npm ERR! code 1
npm ERR! path /runner/_work/<project>/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install
npm ERR! Installing Cypress (version: 13.14.2)
npm ERR! 
npm ERR! [STARTED] Task without title.
npm ERR! The Cypress App could not be downloaded.
npm ERR! 
npm ERR! Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
npm ERR! 
npm ERR! Otherwise, please check network connectivity and try again:
npm ERR! 
npm ERR! ----------
npm ERR! 
npm ERR! URL: https://download.cypress.io/desktop/13.14.2?platform=linux&arch=x64
npm ERR! AggregateError
npm ERR! 
npm ERR! ----------
npm ERR! 
npm ERR! Platform: linux-x64 (Ubuntu - 20.04)
npm ERR! Cypress Version: 13.14.2
npm ERR! 2024-09-12T16:41:34.949Z cypress:cli installing Cypress from NPM
npm ERR! 2024-09-12T16:41:35.356Z cypress:cli installing with options {}
npm ERR! 2024-09-12T16:41:35.360Z cypress:cli detecting arch { osPlatform: 'linux', osArch: 'x64' }
npm ERR! 2024-09-12T16:41:35.401Z cypress:cli arm uname -m result: { stdout: 'x86_64' } 
npm ERR! 2024-09-12T16:41:35.401Z cypress:cli version in package.json is 13.14.2, version to install is 13.14.2
npm ERR! 2024-09-12T16:41:35.433Z cypress:cli Reading binary package.json from: /home/runner/.cache/Cypress/13.14.2/Cypress/resources/app/package.json
npm ERR! 2024-09-12T16:41:35.434Z cypress:cli no binary installed under cli version
npm ERR! 2024-09-12T16:41:35.434Z cypress:cli checking local file /runner/_work/<project>/13.14.2 cwd /runner/_work/<project>/node_modules/cypress
npm ERR! 2024-09-12T16:41:35.434Z cypress:cli preparing to download and unzip version  13.14.2 to path /home/runner/.cache/Cypress/13.14.2
npm ERR! 2024-09-12T16:41:35.444Z cypress:cli needed Cypress version: 13.14.2
npm ERR! 2024-09-12T16:41:35.444Z cypress:cli source url https://download.cypress.io/desktop/13.14.2?platform=linux&arch=x64
npm ERR! 2024-09-12T16:41:35.445Z cypress:cli downloading cypress.zip to "/runner/_work/_temp/cypress-9500.zip"
npm ERR! 2024-09-12T16:41:35.447Z cypress:cli Downloading package {
npm ERR!   url: 'https://download.cypress.io/desktop/13.14.2?platform=linux&arch=x64',
npm ERR!   proxy: null,
npm ERR!   downloadDestination: '/runner/_work/_temp/cypress-9500.zip'
npm ERR! }
npm ERR! 2024-09-12T16:41:35.699Z cypress:cli expected file size 82
npm ERR! 2024-09-12T16:41:35.699Z cypress:cli redirect version: 13.14.2
npm ERR! 2024-09-12T16:41:35.699Z cypress:cli redirect url: https://cdn.cypress.io/desktop/13.14.2/linux-x64/cypress.zip
npm ERR! 2024-09-12T16:41:35.700Z cypress:cli Downloading package {
npm ERR!   url: 'https://cdn.cypress.io/desktop/13.14.2/linux-x64/cypress.zip',
npm ERR!   proxy: null,
npm ERR!   downloadDestination: '/runner/_work/_temp/cypress-9500.zip'
npm ERR! }
npm ERR! 2024-09-12T16:41:39.755Z cypress:cli URL: https://download.cypress.io/desktop/13.14.2?platform=linux&arch=x64
npm ERR! AggregateError
npm ERR! [FAILED] The Cypress App could not be downloaded.
npm ERR! [FAILED] 
npm ERR! [FAILED] Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
npm ERR! [FAILED] 
npm ERR! [FAILED] Otherwise, please check network connectivity and try again:
npm ERR! [FAILED] 
npm ERR! [FAILED] ----------
npm ERR! [FAILED] 
npm ERR! [FAILED] URL: https://download.cypress.io/desktop/13.14.2?platform=linux&arch=x64
npm ERR! [FAILED] AggregateError
npm ERR! [FAILED] 
npm ERR! [FAILED] ----------
npm ERR! [FAILED] 
npm ERR! [FAILED] Platform: linux-x64 (Ubuntu - 20.04)
npm ERR! [FAILED] Cypress Version: 13.14.2

npm ERR! A complete log of this run can be found in: /home/runner/.npm/_logs/2024-09-12T16_38_54_478Z-debug-0.log


### Cypress Version

13.14.2

### Node version

v20.10.0

### Package Manager

npm

### Package Manager Version

10.2.3

### Operating system

Linux

### Operating System Version

Ubuntu 20.04

### Other

_No response_
MikeMcC399 commented 1 month ago

@guillermoz-nutanix

It looks like your logs are from a GitHub Actions workflow. Is that correct?

If yes, is this a GitHub-hosted or self-hosted runner?

MikeMcC399 commented 1 month ago

@guillermoz-nutanix

Are you still having a problem installing Cypress or did you resolve it already?

MikeMcC399 commented 1 month ago

@guillermoz-nutanix

If you are running in GitHub Actions and you are not already using the Cypress GitHub Action you may want to consider using this, since it caches the Cypress App (binary). This will not eliminate errors, but it should reduce the frequency.

guillermoz-nutanix commented 1 month ago

Are you still having a problem installing Cypress or did you resolve it already?

I mitigated it by caching the .cache/cypress folder as mentioned somewhere in the documentation.