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.

Error running in Docker: InitializeSandbox() called with multiple threads in process gpu-process

See original GitHub issue

Current behavior

I want to run Cypress on Jenkins inside Docker.

When runnung npx cypress verify, I get this error:

ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.

Full log:

CYPRESS_CACHE_FOLDER=/home/jenkins/.cache/Cypress DEBUG=cypress:* npx cypress verify
2021-01-14T14:03:55.621Z cypress:cli:cli cli starts with arguments ["/usr/local/bin/node","/var/lib/jenkins/workspace/aseo-e2e-test/node_modules/.bin/cypress","verify"]
2021-01-14T14:03:55.623Z cypress:cli NODE_OPTIONS is not set
2021-01-14T14:03:55.623Z cypress:cli:cli program parsing arguments
2021-01-14T14:03:55.626Z cypress:cli parsed cli options {}
2021-01-14T14:03:55.808Z cypress:cli verifying Cypress app
2021-01-14T14:03:55.809Z cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable
2021-01-14T14:03:55.809Z cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable
2021-01-14T14:03:55.809Z cypress:cli using environment variable CYPRESS_CACHE_FOLDER /home/jenkins/.cache/Cypress
2021-01-14T14:03:55.810Z cypress:cli checking environment variables
2021-01-14T14:03:55.825Z cypress:cli checking if executable exists /home/jenkins/.cache/Cypress/6.2.0/Cypress/Cypress
2021-01-14T14:03:55.834Z cypress:cli Binary is executable? : true
2021-01-14T14:03:55.835Z cypress:cli binaryDir is  /home/jenkins/.cache/Cypress/6.2.0/Cypress
2021-01-14T14:03:55.835Z cypress:cli Reading binary package.json from: /home/jenkins/.cache/Cypress/6.2.0/Cypress/resources/app/package.json
2021-01-14T14:03:55.838Z cypress:cli Found binary version 6.2.0 installed in: /home/jenkins/.cache/Cypress/6.2.0/Cypress
2021-01-14T14:03:55.839Z cypress:cli could not read binary_state.json file at "/home/jenkins/.cache/Cypress/6.2.0/binary_state.json"
2021-01-14T14:03:55.840Z cypress:cli {}
2021-01-14T14:03:55.840Z cypress:cli is Verified ? undefined
2021-01-14T14:03:55.840Z cypress:cli force verify
2021-01-14T14:03:55.840Z cypress:cli running binary verification check 6.2.0
[?25l[14:03:55]  Verifying Cypress can run /home/jenkins/.cache/Cypress/6.2.0/Cypress [started]
2021-01-14T14:03:55.848Z cypress:cli clearing out the verified version
2021-01-14T14:03:55.852Z cypress:cli undefined DISPLAY environment variable
2021-01-14T14:03:55.852Z cypress:cli Cypress will spawn its own Xvfb
2021-01-14T14:03:55.852Z cypress:cli needs Xvfb? true
2021-01-14T14:03:55.852Z cypress:cli Starting Xvfb
2021-01-14T14:03:55.875Z cypress:cli disabling Electron sandbox
2021-01-14T14:03:55.875Z cypress:cli running smoke test
2021-01-14T14:03:55.875Z cypress:cli using Cypress executable /home/jenkins/.cache/Cypress/6.2.0/Cypress/Cypress
2021-01-14T14:03:55.875Z cypress:cli smoke test command: /home/jenkins/.cache/Cypress/6.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=362
2021-01-14T14:03:55.875Z cypress:cli smoke test timeout 30000 ms
2021-01-14T14:04:25.912Z cypress:cli Smoke test failed: Error: Command timed out after 30000 milliseconds: /home/jenkins/.cache/Cypress/6.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=362
Timed out
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Path must be absolute
    at App.c._setDefaultAppPaths (electron/js2c/browser_init.js:5:1330)
    at Object.<anonymous> (electron/js2c/browser_init.js:185:2485)
    at Object../lib/browser/init.ts (electron/js2c/browser_init.js:185:3714)
    at __webpack_require__ (electron/js2c/browser_init.js:1:128)
    at electron/js2c/browser_init.js:1:1200
    at electron/js2c/browser_init.js:1:1267
    at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:277:7)
    at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:219:10)
    at loadNativeModule (internal/modules/cjs/helpers.js:24:9)
    at Module._load (internal/modules/cjs/loader.js:856:15)
[324:0114/140356.503173:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
    at timeoutKill (/var/lib/jenkins/workspace/aseo-e2e-test/node_modules/cypress/node_modules/execa/lib/kill.js:65:23)
    at Timeout._onTimeout (/var/lib/jenkins/workspace/aseo-e2e-test/node_modules/cypress/node_modules/execa/lib/kill.js:81:4)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
  timedOut: true,
  signal: 'SIGTERM',
  originalMessage: 'Timed out',
  shortMessage: 'Command timed out after 30000 milliseconds: /home/jenkins/.cache/Cypress/6.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=362\n' +
    'Timed out',
  command: '/home/jenkins/.cache/Cypress/6.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=362',
  exitCode: undefined,
  signalDescription: 'Termination',
  stdout: '',
  stderr: '\u001b[1m\u001b[47m\u001b[31mA JavaScript error occurred in the main process\n' +
    '\u001b[30mUncaught Exception:\n' +
    'Error: Path must be absolute\n' +
    '    at App.c._setDefaultAppPaths (electron/js2c/browser_init.js:5:1330)\n' +
    '    at Object.<anonymous> (electron/js2c/browser_init.js:185:2485)\n' +
    '    at Object../lib/browser/init.ts (electron/js2c/browser_init.js:185:3714)\n' +
    '    at __webpack_require__ (electron/js2c/browser_init.js:1:128)\n' +
    '    at electron/js2c/browser_init.js:1:1200\n' +
    '    at electron/js2c/browser_init.js:1:1267\n' +
    '    at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:277:7)\n' +
    '    at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:219:10)\n' +
    '    at loadNativeModule (internal/modules/cjs/helpers.js:24:9)\n' +
    '    at Module._load (internal/modules/cjs/loader.js:856:15)\u001b[0m\n' +
    '[324:0114/140356.503173:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.',
  failed: true,
  isCanceled: false,
  killed: false
}
2021-01-14T14:04:25.916Z cypress:cli error message: A JavaScript error occurred in the main process
Uncaught Exception:
Error: Path must be absolute
    at App.c._setDefaultAppPaths (electron/js2c/browser_init.js:5:1330)
    at Object.<anonymous> (electron/js2c/browser_init.js:185:2485)
    at Object../lib/browser/init.ts (electron/js2c/browser_init.js:185:3714)
    at __webpack_require__ (electron/js2c/browser_init.js:1:128)
    at electron/js2c/browser_init.js:1:1200
    at electron/js2c/browser_init.js:1:1267
    at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:277:7)
    at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:219:10)
    at loadNativeModule (internal/modules/cjs/helpers.js:24:9)
    at Module._load (internal/modules/cjs/loader.js:856:15)
[324:0114/140356.503173:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
2021-01-14T14:04:25.916Z cypress:cli error timedOut is true
2021-01-14T14:04:25.942Z cypress:cli Stopping Xvfb
[14:04:25]  Verifying Cypress can run /home/jenkins/.cache/Cypress/6.2.0/Cypress [failed]
[?25hCypress verification timed out.

This command failed with the following output:

/home/jenkins/.cache/Cypress/6.2.0/Cypress/Cypress --no-sandbox --smoke-test --ping=362

----------

Platform: linux (Debian - 10.5)
Cypress Version: 6.2.0

Tried but didn’t worked

Adding this did not help:

// cypress/plugins/index.ts
module.exports = (on, config) => {
  on('before:browser:launch', (browser, launchOptions) => {
    launchOptions.args.push('--disable-gpu');
    launchOptions.args.push('--disable-software-rasterizer');
    return launchOptions;
  });

Versions

Docker: cypress/base:12

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
thyarlescommented, Sep 23, 2022

I had the same issues running a my Dockerfile from jenkins pipeline and I resolved adding this ENV to the Dockerfile:

ENV ELECTRON_EXTRA_LAUNCH_ARGS=--disable-gpu ENV LIBVA_DRIVER_NAME=--disable-software-rasterizer

Hi @jpcampos24, thanks for sharing your discovery. I tried it today and it partly worked for GitHub Actions. After your envs, this error dissapear:

[2514:0923/115646.747817:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

The other one still… so, the env ELECTRON_EXTRA_LAUNCH_ARGS didn’t work, but as I’m using Chrome maybe that was the reason. Thanks!

[2514:0923/115646.738634:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
0reactions
jpcampos24commented, Sep 22, 2022

I had the same issues running a my Dockerfile from jenkins pipeline and I resolved adding this ENV to the Dockerfile:

ENV ELECTRON_EXTRA_LAUNCH_ARGS=--disable-gpu ENV LIBVA_DRIVER_NAME=--disable-software-rasterizer

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error running in Docker: InitializeSandbox() called with ...
ERROR :sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process. Full log: CYPRESS_CACHE_FOLDER=/home/ ...
Read more >
Selenium ChromeDriver gives "InitializeSandbox() called with ...
This error message... ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
Read more >
1112159 - ERROR:sandbox_linux.cc(374)] InitializeSandbox ...
Issue 1112159 : ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process. Reported by schedule sprb.
Read more >
How to resolve InitializeSandbox() called with multiple threads ...
How to resolve InitializeSandbox() called with multiple threads in process gpu-process. Error in Linux with Google Chrome ?
Read more >
[Bug 1563184] [NEW] InitializeSandbox() called with multiple ...
I have had almost the exact same problem on a Raspberry Pi 2 running Ubuntu Mate ... InitializeSandbox() called with multiple threads in...
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