Page MenuHomePhabricator

"The cypress npm package is installed, but the Cypress binary is missing" error prevents merging changes
Closed, ResolvedPublic

Description

The following error prevents merging changes in at least MobileFrontend and DiscussionTools, maybe other repositories:

> selenium-test
> cypress run

The cypress npm package is installed, but the Cypress binary is missing.

We expected the binary to be installed here: /cache/Cypress/13.6.1/Cypress/Cypress

Reasons it may be missing:

- You're caching 'node_modules' but are not caching this path: /cache/Cypress
- You ran 'npm install' at an earlier build step but did not persist: /cache/Cypress

Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.

Alternatively, you can run 'cypress install' to download the binary again.

https://on.cypress.io/not-installed-ci-error

Example failures:

Event Timeline

matmarex triaged this task as Unbreak Now! priority.Apr 1 2024, 8:51 PM
Jdlrobson subscribed.

I think this test is defined in Cite extension if I'm reading the CI log correctly?

In EntitySchema, where we also use Cypress, it seems to be working still (example change and console); Cypress seemingly autoinstalls itself:

> selenium-test
> CYPRESS_CACHE_FOLDER=./cypress/.cache cypress run

It looks like this is your first time using Cypress: 13.6.6

[STARTED] Task without title.
[SUCCESS] Task without title.

Opening Cypress...

I don’t know why it’s not working for Cite, but it could be because Cite doesn’t customize the CYPRESS_CACHE_FOLDER?

The path /cache/Cypress looks suspicious anyways. I’m guessing that it’s partially the result of the test user having their home directory set to /, but according to the cypress docs, the default should be ~/.cache/Cypress, i.e. with a dot before the word “cache”…

Change #1016337 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Cite@master] Configure CYPRESS_CACHE_FOLDER

https://gerrit.wikimedia.org/r/1016337

Quibble sets XDG_CACHE_HOME=/cache. I guess that directory then gets cleared between running npm and running the tests?

Change #1016337 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Configure CYPRESS_CACHE_FOLDER

https://gerrit.wikimedia.org/r/1016337

Lucas_Werkmeister_WMDE claimed this task.
In T361520#9680281, @Tgr wrote:

Quibble sets XDG_CACHE_HOME=/cache. I guess that directory then gets cleared between running npm and running the tests?

Could be, yeah. (Bit annoying that the Cypress docs doesn’t mention that they respect $XDG_CACHE_HOME, but that seems like a plausible source for the path at least.)

I think we can close this task, as the CI blocker is resolved; I don’t know if we should have a follow-up task for not clearing the cache or not.

Seems not properly fixed? https://integration.wikimedia.org/ci/job/wmf-quibble-selenium-php81-docker/20433/console

17:26:07 npm ERR! [FAILED] The Cypress App could not be downloaded.
17:26:07 npm ERR! [FAILED] 
17:26:07 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
17:26:07 npm ERR! [FAILED] 
17:26:07 npm ERR! [FAILED] Otherwise, please check network connectivity and try again:
17:26:07 npm ERR! [FAILED] 
17:26:07 npm ERR! [FAILED] ----------
17:26:07 npm ERR! [FAILED] 
17:26:07 npm ERR! [FAILED] URL: https://download.cypress.io/desktop/13.6.1?platform=linux&arch=x64
17:26:07 npm ERR! [FAILED] Error: Failed downloading the Cypress binary.
17:26:07 npm ERR! [FAILED] Response code: 502
17:26:07 npm ERR! [FAILED] Response message: Bad Gateway
17:26:07 npm ERR! [FAILED] 
17:26:07 npm ERR! [FAILED] ----------
17:26:07 npm ERR! [FAILED] 
17:26:07 npm ERR! [FAILED] Platform: linux-x64 (Debian - 10.13)
17:26:07 npm ERR! [FAILED] Cypress Version: 13.6.1

Didn't reappear during recheck.