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

Cypress 9.1.1 + Node 17.2 (Win 11) Crashes #19320

Closed
Tracked by #4307
NguyenEngine opened this issue Dec 9, 2021 · 17 comments · Fixed by #19522
Closed
Tracked by #4307

Cypress 9.1.1 + Node 17.2 (Win 11) Crashes #19320

NguyenEngine opened this issue Dec 9, 2021 · 17 comments · Fixed by #19522
Assignees

Comments

@NguyenEngine
Copy link

Current behavior

Same as issue which is fixed for Cypress v9.1.1. and Node 17.1 seems to have returned for Cypressv9.1.1. and Node 17.2 : #18914

Desired behavior

No response

Test code to reproduce

no test code required

Cypress Version

9.1.1.

Other

Adding "nodeVersion": "bundled" in the cypress.json works around the issue.

@fazo96
Copy link

fazo96 commented Dec 13, 2021

Same issue on Linux. Using "nodeVersion": "bundled" is necessary if the system's nodejs version is >=17

@ivandjorgon
Copy link

I am experiencing the same issue on MacOS (11.2.1, Big Sur). I upgraded from cypress 9.1.0 to version 9.1.1 and this immediately started happening; no issues whatsoever beforehand while on version 9.1.0.

I've been on node version 17.0.1 & npm version 8.1.0 for a while.

Steps to reproduce:
Upgrade cypress from 9.1.0 to 9.1.1 via command npm install --save-dev cypress@9.1.1

--> Unable to launch cypress test runner or run in headless mode
--> Received the following message output in the terminal .../17.0.1/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

Workaround:
As was mentioned, adding "nodeVersion": "bundled" in the cypress.json temporarily fixes the issue

@marcandre
Copy link

Thanks for the work around ❤️

@emilyrohrbough
Copy link
Member

Additional information / debug logs can found in the duplicate issue of #19409.

@rdar-lab
Copy link

The workaround works, but, you get this message:

Deprecation Warning: nodeVersion is currently set to bundled in the cypress.json configuration file. As of Cypress version 9.0.0 the default behavior of nodeVersion has changed to always use the version of Node used to start cypress via the cli. When nodeVersion is set to bundled, Cypress will use the version of Node bundled with electron. This can cause problems running certain plugins or integrations.
As the nodeVersion configuration option will be removed in a future release, it is recommended to remove the nodeVersion configuration option from cypress.json.

@emilyrohrbough emilyrohrbough self-assigned this Dec 22, 2021
@emilyrohrbough emilyrohrbough added the stage: investigating Someone from Cypress is looking into this label Dec 22, 2021
@cypress-bot cypress-bot bot added stage: waiting and removed stage: investigating Someone from Cypress is looking into this labels Dec 22, 2021
@emilyrohrbough emilyrohrbough added the stage: investigating Someone from Cypress is looking into this label Dec 22, 2021
@emilyrohrbough
Copy link
Member

emilyrohrbough commented Dec 22, 2021

@ivandjorgon In your steps to reproduce,

Upgrade cypress from 9.1.0 to 9.1.1 via command npm install --save-dev cypress@9.1.1
--> Unable to launch cypress test runner or run in headless mode
--> Received the following message output in the terminal .../17.0.1/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

Are you upgrading in an existing project ?

@ivandjorgon
Copy link

@emilyrohrbough Yes, I upgraded in an existing project.

@emilyrohrbough
Copy link
Member

@ivandjorgon Can you provide minimum example of the project you tried to upgrade? Were any plugins in use? Support files?

@cypress-bot cypress-bot bot added stage: product review and removed stage: investigating Someone from Cypress is looking into this stage: waiting labels Dec 22, 2021
@rdar-lab
Copy link

@emilyrohrbough I got the same result when I created a project from scratch (no plugins, just the sample test from the quick starter guide)

@eagleflo
Copy link
Contributor

This issue is still there with Cypress 9.2.0 and Node 17.3. It is caused by #19094, which attempted to work around a previous problem caused by Node 17 upgrading to OpenSSL 3. It looks like Electron doesn't allow setting --openssl-legacy-provider in NODE_OPTIONS and will immediately bail out. (FWIW, I encounter this issue no matter which --browser I tell Cypress to use.)

The workaround of setting nodeVersion: "bundled" sidesteps the issue.

@akx
Copy link

akx commented Jan 3, 2022

Same here – macOS 10.15, Node 17.3.0, Cypress 9.2.0. The nodeVersion: "bundled" workaround works.

@emilyrohrbough
Copy link
Member

emilyrohrbough commented Jan 3, 2022

We are working on resolving this issue. I am still having issues reproducing this consistently with Node 17.2 and 9.2.0. I had produced this locally at one point, however, I am no longer able to create the issue. To ensure we've handled all cases, it'd be best to determine the issue here on why this is inconsistent.

Can you provide the terminal(s) and the the list of ENVs set on your process when Cypress is launched?
Also it'd be helpful if you provided debug logs as well with DEBUG=cypress:*

@eagleflo
Copy link
Contributor

eagleflo commented Jan 3, 2022

As this is a work application, I'm not at liberty to show the whole debug log with lots of identifying information. Most notably NODE_OPTIONS is unset when I try to run cypress run.

The last lines of my debug logs are:

  cypress:server:plugins launching using custom node version { resolvedNodePath: '/usr/bin/node', resolvedNodeVersion: '17.3.0' } +0ms
  cypress:server:plugins forking to run /home/aku/.cache/Cypress/9.2.0/Cypress/resources/app/packages/server/lib/plugins/child/index.js +1ms
/usr/bin/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

I'll reiterate that this issue was introduced by #19094, which attempted to fix a problem explained in #18914 (comment). By commenting out the line introducing this new option, the /usr/bin/node invocation succeeds and the test suite starts to run as expected.

childOptions.env.NODE_OPTIONS += ' --openssl-legacy-provider'

It looks like Node.js 17.3 doesn't support that option at all:

~ $ node -v
v17.3.0
~ $ NODE_OPTIONS=--openssl-legacy-provider node
node: --openssl-legacy-provider is not allowed in NODE_OPTIONS
~ $ echo $?
9

@emilyrohrbough
Copy link
Member

emilyrohrbough commented Jan 3, 2022

Thanks for the info. No disagreement this was introduced by #19094.

Also, are you using any plugins or the default cypress plugin configuration?

@eagleflo
Copy link
Contributor

eagleflo commented Jan 3, 2022

Realized that Node.js as packaged by Arch Linux and Homebrew is actually still built against OpenSSL version 1 and improved the heuristic a little bit.

Here is another very similar issue: cloudflare/wrangler-legacy#2116 & cloudflare/wrangler-legacy#2155.

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: needs review The PR code is done & tested, needs review stage: work in progress labels Jan 4, 2022
emilyrohrbough added a commit that referenced this issue Jan 6, 2022
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Jan 6, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 6, 2022

The code for this is done in cypress-io/cypress#19522, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 10, 2022

Released in 9.2.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.2.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants