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.

Cypress exiting with The Test Runner unexpectedly exited via an exit event with signal SIGILL when run in docker as non-root user

See original GitHub issue

Current behavior

I’m trying to run cypress in an openshift environment. a key feature of the environment is that a unique UID is allocated to your container - so it runs the container as UID:GID 10001234:0 (no named user is specified) rather than 0:0 or 1000:0 (root or node)

I’ve made a docker file using this method of creating a non-root container

https://github.com/cypress-io/cypress-docker-images/tree/master/examples/included-as-non-root-alternative

and included some extra pieces to ensure that the user exists in /etc/passwd, in case that was the problem. (i also had this issue before adding the libnss-wrapper code in prepare.sh)

Desired behavior

cypress verify etc shouldn’t fail to run.

Test code to reproduce

My example docker build and example log files of it failing on my host are here:

https://github.com/michaelkaye/cypress-included-demo

Similar errors occur when trying this on an internal openshift deployment, but i can’t give access to that.

It’s a bit more than minimal as it’s got some of my attempts to fix this as well.

Cypress Version

10.6.0

Node version

16.14.2

Operating System

ubuntu 22.04 / docker

Debug Logs

cypress-included-demo$ docker run -e DEBUG=cypress.* -u 1001:0 cypress-demo cypress verify
2022-09-23T13:27:28.955Z cypress:cli:cli cli starts with arguments ["/usr/local/bin/node","/usr/local/bin/cypress","verify"]
2022-09-23T13:27:28.956Z cypress:cli NODE_OPTIONS is not set
2022-09-23T13:27:28.956Z cypress:cli:cli program parsing arguments
2022-09-23T13:27:28.958Z cypress:cli parsed cli options {}
2022-09-23T13:27:29.042Z cypress:cli verifying Cypress app
2022-09-23T13:27:29.042Z cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable
2022-09-23T13:27:29.042Z cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable
2022-09-23T13:27:29.042Z cypress:cli using environment variable CYPRESS_CACHE_FOLDER /root/.cache/Cypress
2022-09-23T13:27:29.043Z cypress:cli checking environment variables
2022-09-23T13:27:29.045Z cypress:cli checking if executable exists /root/.cache/Cypress/10.6.0/Cypress/Cypress
2022-09-23T13:27:29.047Z cypress:cli Binary is executable? : true
2022-09-23T13:27:29.047Z cypress:cli binaryDir is  /root/.cache/Cypress/10.6.0/Cypress
2022-09-23T13:27:29.047Z cypress:cli Reading binary package.json from: /root/.cache/Cypress/10.6.0/Cypress/resources/app/package.json
2022-09-23T13:27:29.051Z cypress:cli Found binary version 10.6.0 installed in: /root/.cache/Cypress/10.6.0/Cypress
2022-09-23T13:27:29.052Z cypress:cli { verified: true }
2022-09-23T13:27:29.053Z cypress:cli is Verified ? true
2022-09-23T13:27:29.053Z cypress:cli force verify
2022-09-23T13:27:29.053Z cypress:cli running binary verification check 10.6.0
[STARTED] Task without title.
2022-09-23T13:27:29.056Z cypress:cli clearing out the verified version
2022-09-23T13:27:29.058Z cypress:cli undefined DISPLAY environment variable
2022-09-23T13:27:29.058Z cypress:cli Cypress will spawn its own Xvfb
2022-09-23T13:27:29.058Z cypress:cli needs Xvfb? true
2022-09-23T13:27:29.058Z cypress:cli Starting Xvfb
2022-09-23T13:27:29.075Z cypress:cli disabling Electron sandbox
2022-09-23T13:27:29.075Z cypress:cli running smoke test
2022-09-23T13:27:29.075Z cypress:cli using Cypress executable /root/.cache/Cypress/10.6.0/Cypress/Cypress
2022-09-23T13:27:29.075Z cypress:cli smoke test command: /root/.cache/Cypress/10.6.0/Cypress/Cypress --no-sandbox --smoke-test --ping=375
2022-09-23T13:27:29.075Z cypress:cli smoke test timeout 30000 ms
2022-09-23T13:27:30.235Z cypress:cli Smoke test failed: Error: Command was killed with SIGILL (Invalid machine instruction): /root/.cache/Cypress/10.6.0/Cypress/Cypress --no-sandbox --smoke-test --ping=375
2022-09-23T13:27:29.223Z cypress:ts registering ts-node on directory undefined
2022-09-23T13:27:29.278Z cypress:ts Running without ts-node hook in environment "production"
2022-09-23T13:27:30.032Z cypress:server:appdata path: /.config/Cypress/cy/production/cache
2022-09-23T13:27:30.086Z cypress:server:appdata path: /.config/Cypress/cy/production/browsers
2022-09-23T13:27:30.099Z cypress:server:cypress starting cypress with argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
2022-09-23T13:27:30.100Z cypress:server:args argv array: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
2022-09-23T13:27:30.102Z cypress:server:args parsed argv options { options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, 'smoke-test': true, smokeTest: true, ping: 375 } }
2022-09-23T13:27:30.105Z cypress:server:args argv parsed: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app' }
2022-09-23T13:27:30.105Z cypress:server:util:proxy found proxy environment variables {}
2022-09-23T13:27:30.106Z cypress:server:args options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {} }
2022-09-23T13:27:30.106Z cypress:server:args argv options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }
2022-09-23T13:27:30.107Z cypress:server:cypress from argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ] got options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }
    at makeError (/usr/local/lib/node_modules/cypress/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/usr/local/lib/node_modules/cypress/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  shortMessage: 'Command was killed with SIGILL (Invalid machine instruction): /root/.cache/Cypress/10.6.0/Cypress/Cypress --no-sandbox --smoke-test --ping=375',
  command: '/root/.cache/Cypress/10.6.0/Cypress/Cypress --no-sandbox --smoke-test --ping=375',
  exitCode: undefined,
  signal: 'SIGILL',
  signalDescription: 'Invalid machine instruction',
  stdout: '',
  stderr: '2022-09-23T13:27:29.223Z cypress:ts registering ts-node on directory undefined\n' +
    '2022-09-23T13:27:29.278Z cypress:ts Running without ts-node hook in environment "production"\n' +
    '2022-09-23T13:27:30.032Z cypress:server:appdata path: /.config/Cypress/cy/production/cache\n' +
    '2022-09-23T13:27:30.086Z cypress:server:appdata path: /.config/Cypress/cy/production/browsers\n' +
    "2022-09-23T13:27:30.099Z cypress:server:cypress starting cypress with argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]\n" +
    "2022-09-23T13:27:30.100Z cypress:server:args argv array: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]\n" +
    "2022-09-23T13:27:30.102Z cypress:server:args parsed argv options { options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, 'smoke-test': true, smokeTest: true, ping: 375 } }\n" +
    "2022-09-23T13:27:30.105Z cypress:server:args argv parsed: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app' }\n" +
    '2022-09-23T13:27:30.105Z cypress:server:util:proxy found proxy environment variables {}\n' +
    "2022-09-23T13:27:30.106Z cypress:server:args options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {} }\n" +
    "2022-09-23T13:27:30.106Z cypress:server:args argv options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }\n" +
    "2022-09-23T13:27:30.107Z cypress:server:cypress from argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ] got options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }",
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
2022-09-23T13:27:30.236Z cypress:cli error message: 2022-09-23T13:27:29.223Z cypress:ts registering ts-node on directory undefined
2022-09-23T13:27:29.278Z cypress:ts Running without ts-node hook in environment "production"
2022-09-23T13:27:30.032Z cypress:server:appdata path: /.config/Cypress/cy/production/cache
2022-09-23T13:27:30.086Z cypress:server:appdata path: /.config/Cypress/cy/production/browsers
2022-09-23T13:27:30.099Z cypress:server:cypress starting cypress with argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
2022-09-23T13:27:30.100Z cypress:server:args argv array: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
2022-09-23T13:27:30.102Z cypress:server:args parsed argv options { options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, 'smoke-test': true, smokeTest: true, ping: 375 } }
2022-09-23T13:27:30.105Z cypress:server:args argv parsed: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app' }
2022-09-23T13:27:30.105Z cypress:server:util:proxy found proxy environment variables {}
2022-09-23T13:27:30.106Z cypress:server:args options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {} }
2022-09-23T13:27:30.106Z cypress:server:args argv options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }
2022-09-23T13:27:30.107Z cypress:server:cypress from argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ] got options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }
2022-09-23T13:27:30.237Z cypress:cli detecting arch { osPlatform: 'linux', osArch: 'x64' }
2022-09-23T13:27:30.241Z cypress:cli arm uname -m result: { stdout: 'x86_64' } 
2022-09-23T13:27:30.247Z cypress:cli Stopping Xvfb
[FAILED] Cypress failed to start.
[FAILED] 
[FAILED] This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies
[FAILED] 
[FAILED] Please refer to the error below for more details.
[FAILED] 
[FAILED] ----------
[FAILED] 
[FAILED] 2022-09-23T13:27:29.223Z cypress:ts registering ts-node on directory undefined
[FAILED] 2022-09-23T13:27:29.278Z cypress:ts Running without ts-node hook in environment "production"
[FAILED] 2022-09-23T13:27:30.032Z cypress:server:appdata path: /.config/Cypress/cy/production/cache
[FAILED] 2022-09-23T13:27:30.086Z cypress:server:appdata path: /.config/Cypress/cy/production/browsers
[FAILED] 2022-09-23T13:27:30.099Z cypress:server:cypress starting cypress with argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
[FAILED] 2022-09-23T13:27:30.100Z cypress:server:args argv array: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
[FAILED] 2022-09-23T13:27:30.102Z cypress:server:args parsed argv options { options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, 'smoke-test': true, smokeTest: true, ping: 375 } }
[FAILED] 2022-09-23T13:27:30.105Z cypress:server:args argv parsed: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app' }
[FAILED] 2022-09-23T13:27:30.105Z cypress:server:util:proxy found proxy environment variables {}
[FAILED] 2022-09-23T13:27:30.106Z cypress:server:args options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {} }
[FAILED] 2022-09-23T13:27:30.106Z cypress:server:args argv options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }
[FAILED] 2022-09-23T13:27:30.107Z cypress:server:cypress from argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ] got options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }
[FAILED] 
[FAILED] ----------
[FAILED] 
[FAILED] Platform: linux-x64 (Debian - 11.3)
[FAILED] Cypress Version: 10.6.0
Cypress failed to start.

This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies

Please refer to the error below for more details.

----------

2022-09-23T13:27:29.223Z cypress:ts registering ts-node on directory undefined
2022-09-23T13:27:29.278Z cypress:ts Running without ts-node hook in environment "production"
2022-09-23T13:27:30.032Z cypress:server:appdata path: /.config/Cypress/cy/production/cache
2022-09-23T13:27:30.086Z cypress:server:appdata path: /.config/Cypress/cy/production/browsers
2022-09-23T13:27:30.099Z cypress:server:cypress starting cypress with argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
2022-09-23T13:27:30.100Z cypress:server:args argv array: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ]
2022-09-23T13:27:30.102Z cypress:server:args parsed argv options { options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, 'smoke-test': true, smokeTest: true, ping: 375 } }
2022-09-23T13:27:30.105Z cypress:server:args argv parsed: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app' }
2022-09-23T13:27:30.105Z cypress:server:util:proxy found proxy environment variables {}
2022-09-23T13:27:30.106Z cypress:server:args options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {} }
2022-09-23T13:27:30.106Z cypress:server:args argv options: { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }
2022-09-23T13:27:30.107Z cypress:server:cypress from argv [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress', '--no-sandbox', '--smoke-test', '--ping=375' ] got options { _: [ '/root/.cache/Cypress/10.6.0/Cypress/Cypress' ], sandbox: false, smokeTest: true, ping: 375, invokedFromCli: false, cwd: '/app', config: {}, pong: 375 }

----------

Platform: linux-x64 (Debian - 11.3)
Cypress Version: 10.6.0

Other

I’m aware that i’m not running the image directly from the source; but i think i’m trying to use the suggested changes correctly.

I did see this bug: https://github.com/cypress-io/cypress/issues/23854 which seems to be hitting very similar issues to me.

The original usecase i had was actually using the module API to invoke cypress, but the test case above seemed closer to the intended use.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mattvb91commented, Oct 23, 2022

getting the same on 10.10.0

0reactions
nickbreatoncommented, Nov 21, 2022

Looks like there is an outstanding issue that is similar to this – https://github.com/cypress-io/cypress/issues/7045

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress exiting with The Test Runner unexpectedly ... - GitHub
Cypress exiting with The Test Runner unexpectedly exited via an exit event with signal SIGILL when run in docker as non-root user #2726....
Read more >
Cypress Test Runner unexpectedly exited via a exit event with ...
I am running cypress tests. When I run locally, it runs smoothly. when I run in circleCI, it throws error after some execution....
Read more >
cypress-io/cypress - Gitter
I'm trying to wrap my head around to support running through all specs covering ... The Test Runner unexpectedly exited via a exit...
Read more >
Cypress exiting with The Test Runner unexpectedly exited via an ...
Cypress exiting with The Test Runner unexpectedly exited via an exit event with signal SIGILL when run in docker as non-root user ......
Read more >
Read more - IPv6 technology center Leipzig
bash52-014 Bash defers processing additional terminating signals when running the EXIT trap while exiting due to a terminating signal.
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