cypress-docker-images
cypress-docker-images copied to clipboard
Firefox - unable to run scripts in Firefox - cypress/browsers:node12.18.3-chrome89-ff86
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
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
@Fryuni I just tried with --browser /opt/firefox/firefox but still facing same issue
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?