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

Can't run cypress on Kubernetes, runs fine on Docker first #22954

Closed
jonathan-dunn-telus opened this issue Jul 27, 2022 · 2 comments
Closed

Can't run cypress on Kubernetes, runs fine on Docker first #22954

jonathan-dunn-telus opened this issue Jul 27, 2022 · 2 comments
Labels
topic: installation Issue during installation or downloading Cypress

Comments

@jonathan-dunn-telus
Copy link

Current behavior

  1. If I build my Docker image it runs Cypress successfuly
  2. When the image gets deployed to Kubernetes (corporate private cluster) Cypress won't start, I suspect some corporate security policies (like they drop NET_RAW on pods)

Please advise what could be the issue.

Thanks

Debug logs

DEBUG=* DEBUG_DEPTH=3 npx cypress verify
  cypress:cli:cli cli starts with arguments ["/usr/local/bin/node","/home/node/app/node_modules/.bin/cypress","verify"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli:cli program parsing arguments +2ms
  cypress:cli parsed cli options {} +2ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable +2s
  cypress:cli Using CYPRESS_CACHE_FOLDER from environment variable +0ms
  cypress:cli using environment variable CYPRESS_CACHE_FOLDER /home/node/.cache/Cypress +0ms
  cypress:cli checking environment variables +2ms
  cypress:cli checking if executable exists /home/node/.cache/Cypress/9.7.0/Cypress/Cypress +2ms
  cypress:cli Binary is executable? : true +95ms
  cypress:cli binaryDir is  /home/node/.cache/Cypress/9.7.0/Cypress +1ms
  cypress:cli Reading binary package.json from: /home/node/.cache/Cypress/9.7.0/Cypress/resources/app/package.json +199ms
  cypress:cli Found binary version 9.7.0 installed in: /home/node/.cache/Cypress/9.7.0/Cypress +399ms
  cypress:cli { verified: true } +301ms
  cypress:cli is Verified ? true +3ms
  cypress:cli force verify +0ms
  cypress:cli running binary verification check 9.7.0 +1ms

  cypress:cli clearing out the verified version +101ms
  cypress:cli undefined DISPLAY environment variable +0ms
  cypress:cli Cypress will spawn its own Xvfb +0ms
  cypress:cli needs Xvfb? true +3ms
  cypress:cli Starting Xvfb +1ms
  xvfb lock filename /tmp/.X99-lock +0ms
  xvfb lock filename /tmp/.X99-lock +1ms
  xvfb setting DISPLAY :99 +0ms
  xvfb all Xvfb arguments [ ':99', '-screen', '0', '1280x1024x24' ] +91ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +8ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +90ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +10ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +10ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +10ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +15ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +9ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +10ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +10ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +10ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +11ms
  cypress:xvfb _XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
  cypress:xvfb  +0ms
  xvfb checking if started by looking for the lock file /tmp/.X99-lock +52ms
  xvfb lock file /tmp/.X99-lock found after 250 ms +0ms
  cypress:cli disabling Electron sandbox +493ms
  cypress:cli running smoke test +1ms
  cypress:cli using Cypress executable /home/node/.cache/Cypress/9.7.0/Cypress/Cypress +0ms
  cypress:cli smoke test command: /home/node/.cache/Cypress/9.7.0/Cypress/Cypress --no-sandbox --smoke-test --ping=125 +0ms
  cypress:cli smoke test timeout 30000 ms +0ms
  cypress:cli Smoke test failed: Error: Command was killed with SIGKILL (Forced termination): /home/node/.cache/Cypress/9.7.0/Cypress/Cypress --no-sandbox --smoke-test --ping=125
2022-07-27T14:29:14.784Z cypress:ts register TypeScript project /home/node/.cache/Cypress/9.7.0/Cypress/resources/app/packages/ts/tsconfig.json fast? true
2022-07-27T14:29:17.889Z cypress:ts Running without ts-node hook in environment "production"
2022-07-27T14:29:24.884Z cypress:server:appdata path: /home/node/.config/Cypress/cy/production/browsers
    at makeError (/home/node/app/node_modules/cypress/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/node/app/node_modules/cypress/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  shortMessage: 'Command was killed with SIGKILL (Forced termination): /home/node/.cache/Cypress/9.7.0/Cypress/Cypress --no-sandbox --smoke-test --ping=125',
  command: '/home/node/.cache/Cypress/9.7.0/Cypress/Cypress --no-sandbox --smoke-test --ping=125',
  exitCode: undefined,
  signal: 'SIGKILL',
  signalDescription: 'Forced termination',
  stdout: '',
  stderr: '2022-07-27T14:29:14.784Z cypress:ts register TypeScript project /home/node/.cache/Cypress/9.7.0/Cypress/resources/app/packages/ts/tsconfig.json fast? true\n' +
    '2022-07-27T14:29:17.889Z cypress:ts Running without ts-node hook in environment "production"\n' +
    '2022-07-27T14:29:24.884Z cypress:server:appdata path: /home/node/.config/Cypress/cy/production/browsers',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
} +22s
  cypress:cli error message: 2022-07-27T14:29:14.784Z cypress:ts register TypeScript project /home/node/.cache/Cypress/9.7.0/Cypress/resources/app/packages/ts/tsconfig.json fast? true
2022-07-27T14:29:17.889Z cypress:ts Running without ts-node hook in environment "production"
2022-07-27T14:29:24.884Z cypress:server:appdata path: /home/node/.config/Cypress/cy/production/browsers +1ms
  cypress:cli Stopping Xvfb +22s
  xvfb restoring process.env.DISPLAY variable +22s
  xvfb lock filename /tmp/.X99-lock +0ms
  xvfb lock file /tmp/.X99-lock +0ms

Cypress Version

9.7.0

Package Manager

npm

Operating system

Linux

Other

No response

@jonathan-dunn-telus jonathan-dunn-telus added the topic: installation Issue during installation or downloading Cypress label Jul 27, 2022
@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 27, 2022
@mjhenkes mjhenkes assigned AtofStryker and unassigned mjhenkes Aug 2, 2022
@AtofStryker
Copy link
Contributor

hello @jonathan-dunn-telus. Thank you for opening an issue. Are you able to share out the docker image to help us reproduce the issue? It looks like there might be permission issues possibly when executing Cypress inside the pod. Are you able to SSH into the pod and run the image as root?

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Aug 4, 2022
@nagash77
Copy link
Contributor

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: installation Issue during installation or downloading Cypress
Projects
None yet
Development

No branches or pull requests

4 participants