cypress: Launch Hanging on Ubuntu when `snap` version of Chromium is installed

Current behavior:

cypress open does not open Cypress. cypress run just seems to hang.

Logs: https://pastebin.com/ULZwQEj8

Snapshot of behavior and logs: https://files.gitter.im/cypress-io/cypress/g4g2/image.png

System: image

Desired behavior:

Should be able to run tests.

Test code to reproduce

As this is happening prior to Cypress running I don’t think its anything I can give reproduction steps for.

DEBUG=* $(npm bin)/cypress open DEBUG=* $(npm bin)/cypress run

Are the commands I am running.

Versions

v4.3.0 and v4.4.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 11
  • Comments: 22 (6 by maintainers)

Most upvoted comments

I also have that issue:

  • tried npm cache clean
  • xvfb reset
  • reinstall packages

Similar issue that I reported: https://github.com/cypress-io/cypress/issues/7027

Removed chromium from snapd and regular apt and now is worked.

Also solved by uninstalling the snap version of Chromium. Thanks @Lektro9 & @jbpallingayan.

Why is the error present even when I execute cypress with the run --browser firefox command?

@erosval Internally, that command runs the regular browser detection and then filters “firefox” from the list of detected browsers, so it hangs in the same place. It should probably be optimized to only lookup browsers matching the passed flag.

Try passing --browser /absolute/path/to/firefox to launch by a path directly, it might work since it should bypass browser detection entirely.


Is it possible to run cypress without chromium (even if installed with snap) and possibly report the problem with a message on the UI?

Yeah, in the meantime, Cypress could still detect the Snap version of Chromium, and add a warning to it in the GUI that it may fail to launch. But I’d like to do some investigation to see if there’s an easy way for users to fix this… for example, if it’s possible to whitelist the Cypress profile dir manually, which would be like a one-time fix we can document and point users to.

I can reproduce this by installing Chromium as a snap instead of via apt.

Workaround:

Install Chromium via apt (apt install chromium-browser) instead

stuck today on my work. i refresh everything but none of that resolve the issue. please help @bahmutov @jennifer-shehane

Fixed it by removing chromium browser on my laptop

And a workaround that doesn’t require any changes in packages, change the path for the command until the patch is on npm:

For fish shells:

env PATH="/home/rohdef/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin /usr/bin:/sbin:/bin" nom run ...

for bash and similar:

PATH="/home/rohdef/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin /usr/bin:/sbin:/bin" npm run ...

Make sure to adjust the path for your system, so start by doing echo $PATH and ensure that you don’t leave important things out, and make sure not to have /snap/bin in your path

Yes, I use Chrome, not Chromium-browser. Sometimes I liked having chromium for a few tests, but since I haven’t used it for a long time, it doesn’t bother me to uninstall it.

The command that I ran to remove chromium was: sudo snap remove chromium