question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad Option: --no-sandbox thrown when ELECTRON_RUN_AS_NODE=1

See original GitHub issue

Current behavior

I am working to integrate cypress testing into our CI. I was getting Xvfb errors, so I started using the ELECTRON_RUN_AS_NODE=1 env variable.

However, when that variable is fixed, it fixes the Xvfb errors but causes some bad option errors.

build	23-Sep-2021 15:20:16	> cypress run --config-file ./e2e/cypressAngular.headless.json --headless -b chrome
build	23-Sep-2021 15:20:16	
build	23-Sep-2021 15:20:16	It looks like this is your first time using Cypress: 8.3.0
build	23-Sep-2021 15:20:16	
build	23-Sep-2021 15:20:16	[STARTED] Task without title.
error	23-Sep-2021 15:20:17	[FAILED] Cypress failed to start.
build	23-Sep-2021 15:20:17	Cypress failed to start.
build	23-Sep-2021 15:20:17	
build	23-Sep-2021 15:20:17	This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
build	23-Sep-2021 15:20:17	
build	23-Sep-2021 15:20:17	Please refer to the error below for more details.
build	23-Sep-2021 15:20:17	
build	23-Sep-2021 15:20:17	----------
build	23-Sep-2021 15:20:17	
build	23-Sep-2021 15:20:17	/usr/local/bamboo/.cache/Cypress/8.3.0/Cypress/Cypress: bad option: --no-sandbox
build	23-Sep-2021 15:20:17	/usr/local/bamboo/.cache/Cypress/8.3.0/Cypress/Cypress: bad option: --smoke-test
build	23-Sep-2021 15:20:17	/usr/local/bamboo/.cache/Cypress/8.3.0/Cypress/Cypress: bad option: --ping=68
build	23-Sep-2021 15:20:17	
build	23-Sep-2021 15:20:17	----------
build	23-Sep-2021 15:20:17	
build	23-Sep-2021 15:20:17	Platform: linux (CentOS - 7.9.2009)
build	23-Sep-2021 15:20:17	Cypress Version: 8.3.0

Desired behavior

Run the tests

Test code to reproduce

My configuration is:

{
  "fileServerFolder": ".",
  "fixturesFolder": "./e2e/fixtures",
  "integrationFolder": "./e2e/integration",
  "modifyObstructiveCode": false,
  "pluginsFile": "./e2e/plugins/index.ts",
  "supportFile": "./e2e/support/index.ts",
  "video": false,
  "videosFolder": "./e2e/videos",
  "screenshotsFolder": "./e2e/screenshots",
  "chromeWebSecurity": false,
  "baseUrl": "http://localhost:4200",
  "viewportHeight": 960,
  "viewportWidth": 1536,
  "env": {
    "tsConfig": "./e2e/tsconfig.json"
  },
  "ignoreTestFiles": [
    "**/__snapshots__/*",
    "**/__image_snapshots__/*"
  ]
}

I am also setting the env var ELECTRON_RUN_AS_NODE=1 externally by using export ELECTRON_RUN_AS_NODE=1

Cypress Version

v8.3.0 (Also tested in 8.4.1)

Other

Not sure if the issue is related or not, but I can’t test this issue locally because when I set the ELECTRON_RUN_AS_NODE=1 env variable I get the error Error: Cannot find module '/Users/reidkersey/Library/Caches/Cypress/8.3.0/Cypress.app/Contents/MacOS/Contents/Resources/app/index.js'

I have also tried setting "ELECTRON_RUN_AS_NODE": "1" in the env section of the config file, and that didn’t work, and gave me the Xvfb error.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:6

github_iconTop GitHub Comments

3reactions
MarcusElevaitcommented, Aug 15, 2022

Same here with cypress 10.3.1

3reactions
roobycommented, May 27, 2022

Same thing with Cypress 9.7.0, and I am using Chrome

Read more comments on GitHub >

github_iconTop Results From Across the Web

FATAL: Running as root without --no-sandbox is not supported ...
I had a similar issue when I run my electron app with sudo: sudo ./MyElectronApp.
Read more >
Bug #1944468 “Electron applications all crash upon launch”
When either application was provided "--no-sandbox" at the command ... It would be very bad if Electron apps failed to function when 21.10 ......
Read more >
OpenShift Container Platform 4.11 Nodes
Setting command-line arguments for container commands with config maps ... to run as privileged containers, run as a user of their choice, ...
Read more >
PureData System for Operational Analytics known issues - IBM
Reference Number Type Impacted Versons KI007421. HMC fw update fails in getupgfiles step. Fixpack I_V1.0.0.5. I_V1.1.0.1 KI007470. Preview failed for flash storage Fixpack I_V1.1.0.1 KI007598. apply:...
Read more >
OMADM.pdf - Oracle Help Center
Oracle Corporation and its affiliates are not responsible for and ... Using Real-Time Purge and Archival Option in Oracle Identity Manager.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found