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

Firefox - unable to run scripts in Firefox - cypress/browsers:node12.18.3-chrome89-ff86 #571

Closed
varshanharshank opened this issue Jan 5, 2022 · 3 comments

Comments

@varshanharshank
Copy link

varshanharshank commented Jan 5, 2022

Getting below error while running cypress scripts in firefox browser

Cypress version - 9.2.0

Docker image- Tried with below images

cypress/browsers:node12.18.3-chrome89-ff86
cypress/browsers:node14.17.0-chrome91-ff89

Note: It is working fine in chrome browser

ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
Failed to connect to the bus: Address does not contain a colon
ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

image

image

@Fryuni
Copy link

Fryuni commented Jan 6, 2022

We found that this problem only happen for us when we run the container with a non-root user. Our solving steps were as follows:

First, we changed the container to run as root. This failed with firefox not being identified on the system.
This is the problem reported on #85, but the problem is not running as root per se, actually firefox only blocks running as a user that does not own the $HOME path.

Second, we removed our $HOME var and passed the full firefox path to cypress (--browser /opt/firefox/firefox). This works, but all artifacts generated are now own by the root user.

Third, we added a script to run at the end of the test suite that chowns the artifacts back to the correct user.

Those steps are only necessary for Firefox due to it's security restriction.

Hope this helps everyone else that reaches a similar problem

@varshanharshank
Copy link
Author

@Fryuni I just tried with --browser /opt/firefox/firefox but still facing same issue

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Oct 18, 2023

The error message output by Firefox 117 in a similar situation running on GitHub is:

"Running Firefox as root in a regular user's session is not supported. ($HOME is /github/home which is owned by uid 1001.)"

Advice to avoid this error is now included in the README.

Perhaps this issue could be closed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants