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

CircleCI :: Cypress Binary Download Fails #4840

Closed
lots0logs opened this issue Jul 27, 2019 · 13 comments
Closed

CircleCI :: Cypress Binary Download Fails #4840

lots0logs opened this issue Jul 27, 2019 · 13 comments

Comments

@lots0logs
Copy link

Current behavior:

Cypress fails to download the binary when running yarn install on CircleCI:

yarn install v1.15.2
warning package.json: No license field
warning No license field
[1/5] Validating package.json...
warning No license field
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @cypress/code-coverage@1.4.0" has unmet peer dependency "nyc@*".
warning " > @cypress/code-coverage@1.4.0" has unmet peer dependency "istanbul-lib-coverage@*".
[5/5] Building fresh packages...
error /workspace/core-products/Divi/core/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments: 
Directory: /workspace/core-products/Divi/core/node_modules/cypress
Output:
Installing Cypress (version: 3.4.0)

[03:33:58]  Downloading Cypress     [started]
[03:33:59]  Downloading Cypress     [failed]
The Cypress App could not be downloaded.

Please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop/3.4.0?platform=linux&arch=x64
Error: Corrupted download

Expected downloaded file to have checksum: 92ead24d077815fc02b8a42fba398cd9136f79fc8b6f2a07fe3f7137b365087b34039397bcda195b62db3da3e98643bf9647519e96b46eecfb243ca198d0d0c2
Computed checksum: b8f24b6c391bb66b2636764630145cf976139ec3208b795051fca3957c5ef932c4047257d6d271df1302a8c2d0eec800640beb60bceecfaabd951850d717f894

Expected downloaded file to have size: 141130568
Computed size: 148305408

----------

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.4.0

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Steps to reproduce: (app code and test code)

  1. Run yarn install on CircleCI

Versions

Cypress 3.4.0

@lots0logs
Copy link
Author

lots0logs commented Jul 27, 2019

Note: I can see the cypress.zip file in the /tmp directory after the error occurs. Not sure why its failing both the filesize and the checksum checks 🤔

If I manually download the binary inside of the CircleCI container using wget, the file is downloaded without error and the file size and checksum are the same as when I download it from my local system (linux).

cypress.zip 135M
92ead24d077815fc02b8a42fba398cd9136f79fc8b6f2a07fe3f7137b365087b34039397bcda195b62db3da3e98643bf9647519e96b46eecfb243ca198d0d0c2 

@jennifer-shehane
Copy link
Member

Can you verify that you don't have 2 versions of Cypress (even if same version) attempting to download and clobbering one another? This happens in some yarn setups as described here: #4595

@cypress-bot cypress-bot bot added the stage: awaiting response Potential fix was proposed; awaiting response label Jul 30, 2019
@rchod
Copy link

rchod commented Aug 7, 2019

Hello @jennifer-shehane ,
I'm facing the same problem so as a quick workaround I tried to download cypress manually via wget and specify the local directory in CYPRESS_INSTALL_BINARY
as mentionned in the docs:
image

[4/4] Building fresh packages...
error /builds/project-0/app/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments: 
Directory: /builds/project-0/app/node_modules/cypress
Output:
⚠ Warning: Forcing a binary version different than the default.

  The CLI expected to install version: 3.4.0

  Instead we will install version: /builds/project-0/app/node_modules/cypress.zip

  These versions may not work properly together.

Installing Cypress (version: /builds/project-0/app/node_modules/cypress.zip)

[11:55:44]  Downloading Cypress     [started]
[11:55:44]  Downloading Cypress     [failed]
The Cypress App could not be downloaded.

Please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop//builds/project-0/app/node_modules/cypress.zip?platform=linux&arch=x64
Error: Failed downloading the Cypress binary.
Response code: 404
Response message: Not Found

----------

Platform: linux (Debian - 9.9)
Cypress Version: 3.4.0

and when I try to use the cypress/included:3.4.0 docker image and skip the installation with CYPRESS_INSTALL_BINARY=0 I get this

image

@rchod
Copy link

rchod commented Aug 9, 2019

@jennifer-shehane the problem was that in my package.json I had this:

   "@types/cypress": "^1.1.3", 
   "cypress": "^3.4.0",

When I removed @types/cypress then the download was OK and gitlab job finished successfully. But I don't know why I don't get this problem on my local machine

@joekrump
Copy link

@rchod I'm running into this issue as well, however, I did not have @types/cypress as a devDependency. I'm running into this issue on BuildKite CI:

[2019-08-15T23:31:57Z] Installing Cypress (version: 3.4.0)
--
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] [23:31:55]  Downloading Cypress     [started]
  | [2019-08-15T23:31:57Z] [23:31:57]  Downloading Cypress     [failed]
  | [2019-08-15T23:31:57Z] The Cypress App could not be downloaded.
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] Please check network connectivity and try again:
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] ----------
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] URL: https://download.cypress.io/desktop/3.4.0?platform=linux&arch=x64
  | [2019-08-15T23:31:57Z] Error: Corrupted download
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] Expected downloaded file to have checksum: 92ead24d077815fc02b8a42fba398cd9136f79fc8b6f2a07fe3f7137b365087b34039397bcda195b62db3da3e98643bf9647519e96b46eecfb243ca198d0d0c2
  | [2019-08-15T23:31:57Z] Computed checksum: 359c7c2df2c051048d3f2bd278b62a11457df9a756ebc61a4a28da1ff0e5c07d6d1dd25e774fca7cbe9ada9ef0f9847926026d21b4447d1d400db671fd1e7cf6
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] Expected downloaded file to have size: 141130568
  | [2019-08-15T23:31:57Z] Computed size: 141130568
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] ----------
  | [2019-08-15T23:31:57Z]
  | [2019-08-15T23:31:57Z] Platform: linux (Debian - 9.9)
  | [2019-08-15T23:31:57Z] Cypress Version: 3.4.0
  | [2019-08-15T23:31:57Z]


@joekrump
Copy link

@lots0logs, perhaps this is a bug in the Cypress code, however, I think the cause of the issue stems a bit from the use of yarn for package management. I think I've resolved the issue and here's what I did:

  1. Checked the yarn.lock file in my project and observed that I had several entries for cypress and they pointed to different versions.
  2. Updated various dependencies so that any dependency that had cypress as a subdependency ended up resolving to the same version of cypress (in my case 3.4.1).

Outcome

I now have a single entry for cypress in my yarn.lock file which resolves to the version of cypress that I've specified in my package.json file (3.4.1 for me). Here's what this looks like. I hope this helps:

cypress@3.4.1, cypress@^3.1.5:
  version "3.4.1"
  resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.4.1.tgz#ca2e4e9864679da686c6a6189603efd409664c30"
  integrity sha1-yi5OmGRnnaaGxqYYlgPv1AlmTDA=
  dependencies:
    "@cypress/listr-verbose-renderer" "0.4.1"
    "@cypress/xvfb" "1.2.4"
    arch "2.1.1"
    bluebird "3.5.0"
    cachedir "1.3.0"
    chalk "2.4.2"
    check-more-types "2.24.0"
    commander "2.15.1"
    common-tags "1.8.0"
    debug "3.2.6"
    execa "0.10.0"
    executable "4.1.1"
    extract-zip "1.6.7"
    fs-extra "5.0.0"
    getos "3.1.1"
    is-ci "1.2.1"
    is-installed-globally "0.1.0"
    lazy-ass "1.6.0"
    listr "0.12.0"
    lodash "4.17.15"
    log-symbols "2.2.0"
    minimist "1.2.0"
    moment "2.24.0"
    ramda "0.24.1"
    request "2.88.0"
    request-progress "3.0.0"
    supports-color "5.5.0"
    tmp "0.1.0"
    url "0.11.0"
    yauzl "2.10.0"

@nikhilesh009
Copy link

I am facing the same issue while using 3.4.1, I have rolled back to 3.2.0

@bfagundez
Copy link

same inside alpine linux:

URL: https://download.cypress.io/desktop/3.4.1?platform=linux&arch=x64
Error: Corrupted download

Expected downloaded file to have checksum: 1d83944c77bc9628909ea095ea15e85dd2c2e728a3440330c42eb49cc4f3260a9276ee9f176db7f462cf8031c42744bdd3f459927f2f4c00828b969b5cb8df7a
Computed checksum: 82e9bbbef3c438f6a1372adaa8f48f161972c686cb480bfb0c1bb81545d7e059f07f178c6f44564640e14c437dd31e51a7e31bd4a8a84cafa842c91adea6ed23

Expected downloaded file to have size: 138660520
Computed size: 138660520

----------

Platform: linux (Raspbian - )
Cypress Version: 3.4.1

@katz12
Copy link

katz12 commented Oct 29, 2019

I am also finding that https://download.cypress.io/desktop/3.4.1?platform=linux&arch=x64 is not downloading a file with checksum matching 1d83944c77bc9628909ea095ea15e85dd2c2e728a3440330c42eb49cc4f3260a9276ee9f176db7f462cf8031c42744bdd3f459927f2f4c00828b969b5cb8df7a. This is the same checksum that the post above is expecting.

URL: https://download.cypress.io/desktop/3.4.1?platform=linux&arch=x64
Error: Corrupted download

Expected downloaded file to have checksum: 1d83944c77bc9628909ea095ea15e85dd2c2e728a3440330c42eb49cc4f3260a9276ee9f176db7f462cf8031c42744bdd3f459927f2f4c00828b969b5cb8df7a
Computed checksum: ad886760ad29d78e56f2b072472cc43f909519169d4e8a872b63dcdee62cedddc96fdf60bbf2195f38e224f0bff2c0078a3dd959cc573f99a6362ffe1ba15428

Expected downloaded file to have size: 138660520
Computed size: 138660520

----------

Platform: linux (Debian - 8.11)
Cypress Version: 3.4.1

We are finding that this is likely happening after adding a new dependency that is pulling in a different version of Cypress. In this case we are targeting cypress@3.4.1 but @types/testing-library__cypress@^5.0.0 is pulling in cypress@3.5.0.

@netcoding87
Copy link

We also found this problem when downloading https://download.cypress.io/desktop/3.6.1?platform=linux&arch=x64 with checksum 1c887ae436316e59f53be57d0c0a8c1e4b483ad40dd7b7e90d2da740f777eb64f93838d09446a2c48cd68f0292d710f1f53a03afff4e0f2d47d410767c90387a

2019-11-12T08:09:22.3025405Z URL: https://download.cypress.io/desktop/3.6.1?platform=linux&arch=x64
2019-11-12T08:09:22.3039014Z Error: Corrupted download
2019-11-12T08:09:22.3045635Z 
2019-11-12T08:09:22.3059802Z Expected downloaded file to have checksum: 1c887ae436316e59f53be57d0c0a8c1e4b483ad40dd7b7e90d2da740f777eb64f93838d09446a2c48cd68f0292d710f1f53a03afff4e0f2d47d410767c90387a
2019-11-12T08:09:22.3075456Z Computed checksum: a3c41f22aa6caf0824cc2d3ec7b2c4bc4e8d0a4350be53bf8697ce9abe273388ffacf83c5a1f1df899b83c9a9a2e39913f73f5210a5ba9dfc8e591f09db3689b
2019-11-12T08:09:22.3082866Z 
2019-11-12T08:09:22.3096772Z Expected downloaded file to have size: 152981007
2019-11-12T08:09:22.3110889Z Computed size: 152981007
2019-11-12T08:09:22.3118052Z 
2019-11-12T08:09:22.3131789Z ----------
2019-11-12T08:09:22.3139472Z 
2019-11-12T08:09:22.3153736Z Platform: linux (Ubuntu Linux - 18.04)
2019-11-12T08:09:22.3167230Z Cypress Version: 3.6.1

In our package.json we are also referencing @testing-library/cypress in version ^5.0.2. This seems to pull cypress in version 3.6.0.

  "devDependencies": {
    "@testing-library/cypress": "^5.0.2",
    "cypress": "^3.6.1",
    ...

@bkoltai
Copy link

bkoltai commented Dec 16, 2019

Here is how I resolved my Error: Corrupted download issue on CircleCI:

Following some suggestions here, I checked to see what versions of cypress I was dependent on using yarn why cypress. This showed that I indeed had 2 different versions. I then added the following to my package.json to pick the version I wanted

  "resolutions": {
    "cypress": "3.8.0"
  }

When I re-ran yarn why cypress I saw only 1 version. The build then passed.

Hope this helps others who come across this issue!

@jennifer-shehane
Copy link
Member

Closing this as a duplicate of #4595

Please follow some of the existing workaround to ensure you do not have 2 versions of Cypress downloaded as detailed here: #4840 (comment)

@jenniferpham
Copy link

jenniferpham commented Nov 11, 2020

What worked for me was:
adding "resolutions" block into package.json, changing Cypress-related library versions to the exact version in package.json and reinstalling packages.

  "resolutions": {
    "cypress": "5.4.0"
  }
"cypress": "^5.4.0" -> "5.4.0"
"tslint-plugin-cypress": "^1.0.4" -> "1.0.4"
"@testing-library/cypress": "^7.0.1" =>  "7.0.1"
"@types/testing-library__cypress": "^5.0.8" -> "5.0.8"

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

10 participants