cypress-docker-images icon indicating copy to clipboard operation
cypress-docker-images copied to clipboard

Simple test working in Electron but not Chrome

Open drewwats opened this issue 5 years ago • 27 comments

Using this command:

docker run -it -v $PWD:/e2e -v /tmp/.X11-unix:/tmp/.X11-unix -w /e2e -e DISPLAY --entrypoint cypress cypress/included:3.4.1 open --project .

Works fine on 3.2.0 but on 3.4.0 and 3.4.1, I get the error below:

[16:0925/190224.704846:ERROR:bus.cc(395)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[16:0925/190229.509065:ERROR:bus.cc(395)] Failed to connect to the bus: Address does not contain a colon
[16:0925/190229.591568:ERROR:bus.cc(395)] Failed to connect to the bus: Address does not contain a colon
[16:0925/190410.068518:ERROR:bus.cc(395)] Failed to connect to the bus: Address does not contain a colon

The xsession still opens, regardless of error, but test does not run on Chrome, works fine in Electron. For reference, the test file I'm using is very simple:

describe('test_name', function() {

 it('what_it_does', function() {
    cy.visit('https://www.wikipedia.org/')
    cy.viewport(1920, 1080)
    cy.visit('https://www.wikipedia.org/')
    cy.get('.search-container > #search-form > fieldset > #search-input > #searchInput').type('ww1')
    cy.get('#www-wikipedia-org > .search-container > #search-form > fieldset > .pure-button').click()
    cy.visit('https://en.wikipedia.org/wiki/Ww1')
 })
})

drewwats avatar Sep 25 '19 19:09 drewwats

I'm having the same issue although my first warning is slightly different. It only happens on on subsequent runs of the same image - the first one goes through fine and then re-upping the stack throws the error:

Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
(Cypress:38): dconf-WARNING **: failed to commit changes to dconf: Address element '/dev/null' does not contain a colon (:)
(Cypress:38): dconf-WARNING **: failed to commit changes to dconf: Address element '/dev/null' does not contain a colon (:)
... etc 

FWIW it seems to be related to this line if you check the related discussion (cypress/included images at 3.3.0 and below use cypress/base instead of cypress/nodechrome as their base which don't set that environment variable).

EDIT After looking into it more it appears my issue is slightly different (despite both having the Address element '/dev/null' does not contain a colon (:) warning). Mine appears to work fine in electron but not chrome.

zbarbuto avatar Sep 30 '19 05:09 zbarbuto

I am receiving the same error as @zbarbuto , though my tests run as expected.

MisterGlass avatar Dec 06 '19 17:12 MisterGlass

I’m also running into the same error, on the cypress/included:3.8.3 image.

robcole avatar Mar 04 '20 18:03 robcole

How about cypress/included:4.1.0?

bahmutov avatar Mar 04 '20 19:03 bahmutov

I'm getting the same error with cypress/included:4.1.0

vladonemo avatar May 28 '20 14:05 vladonemo

Seeing the same, running cypress/included:4.12.1 via open.

Some observations:

  • Tests always run with Electron.
  • Tests sometimes run and sometimes the Browser crashes with Chrome.
    • In Chrome, the URL it tries to load looks like http://host.docker.internal:9000/__/#/tests/integration/example.test.js, but in Electron it simply looks like http://host.docker.internal:9000/.
  • No matter the Browser, the Terminal spams the Failed to connect to the bus: Address does not contain a colon message about once every 30 seconds.

the0neWhoKnocks avatar Sep 07 '20 19:09 the0neWhoKnocks

I'm getting the same error with cypress/included:5.2.0. Any update on that? @drewwats

sebastian-kreft avatar Oct 30 '20 11:10 sebastian-kreft

the same cypress/included:6.0.1, kubernetes teamcity build

kamiloski avatar Dec 03 '20 08:12 kamiloski

Can we have a reproducible example to see this?

bahmutov avatar Dec 30 '20 15:12 bahmutov

Getting it on cypress/included:8.6.0 but does not seem to affect the actual test execution.

mjakubowski avatar Oct 26 '21 08:10 mjakubowski

Same here on cypress/browsers:node16.5.0-chrome94-ff93 on gitlab ci/cd pipeline

[420:1026/124639.420009:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [420:1026/124639.420079:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [420:1026/124639.425881: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 [577:1026/124639.541968:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is swiftshader

And all my test are failing

AndriiUhrynNewNew avatar Oct 26 '21 12:10 AndriiUhrynNewNew

Same for me using cypress/browsers:node14.16.0-chrome89-ff86 together with cypress 8.7.0

shdb2 avatar Oct 26 '21 13:10 shdb2

Same here on cypress/browsers:node16.5.0-chrome94-ff93 on gitlab ci/cd pipeline

[420:1026/124639.420009:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [420:1026/124639.420079:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [420:1026/124639.425881: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 [577:1026/124639.541968:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is swiftshader

And all my test are failing

i am facing similar issue while using 'cypress/browsers:node16.5.0-chrome94-ff93'

Mufeez avatar Oct 26 '21 14:10 Mufeez

After upgrading from 8.3.0 to 8.7.0 i am also facing this issue.

Used image was in both cases cypress/browsers:node14.17.0-chrome91-ff89

capc0 avatar Oct 29 '21 08:10 capc0

Same issue as @capc0. Tried updating to 9.0.0 but now my Cypress does not run because pluginsFile is broken without any meaningful information. Anyone knows how to resolve?

This problem prevents my component tests from running in the GitLab pipeline

FranciscoKloganB avatar Nov 17 '21 00:11 FranciscoKloganB

For us the issue started happening when we upgraded the version from v8.3.0 to v8.7.0

[252:1119/002917.956456:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [252:1119/002917.962851:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 756: Permission denied (13)

Shall send across the logs and pipeline.yml + package.json file, if required.

gagneet avatar Nov 19 '21 02:11 gagneet

I can confirm the same using cypress/browsers:node16.5.0-chrome94-ff93 with cypress 9.0.0

The tests execute and pass ok but error is outputted once after loading each test file.

markpol avatar Nov 22 '21 15:11 markpol

I have the same issue with 9.1.0, the following error message appears after every test:

[156:1126/133636.214533:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon

The tests are passing but the overall process is extremely slow. Before updating it was taking around 10 minutes to run my tests but now it takes about 1 hour.

julienvonoetinger-eaton avatar Nov 26 '21 14:11 julienvonoetinger-eaton

Downgrade to the 8.3.0 during investigations.

comxd avatar Dec 03 '21 11:12 comxd

I also have this issue with cypress 9.1.1. It is absolutely reproducible, test execution even unexpectedly finishes in the middle of a run. Without docker, test run works for sure

jenkins pipeline script has ls && docker build . -t test:latest --no-cache docker run --rm test:latest -e ENV_NAME=STG docker stop test:latest

after docker run in Jenkins console log there are a lot of these messages

[18:1210/121019.861624: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 [18:1210/121019.873351:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [18:1210/121019.873494:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon [205:1210/121019.919441:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

The test execution unexpectedly stops with the following

[18:1210/121343.353037:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon The Test Runner unexpectedly exited via a exit event with signal SIGSEGV

Please search Cypress documentation for possible solutions: Check if there is a GitHub issue describing this crash: https://github.com/cypress-io/cypress/issues Consider opening a new issue

Platform: linux-x64 (Debian - 10.11) Cypress Version: 9.1.1

Any ideas?

rararif avatar Dec 10 '21 12:12 rararif

I think this is the same as https://github.com/cypress-io/cypress/issues/18681

Develliot avatar Dec 10 '21 13:12 Develliot

This is an absolute hack, but so far it seems to be working for us. We already roll our own cypress containers (because cypress never keeps them patched well enough), but if you don't you should be able to do similar by taking their containers as the base.

First install dbus.

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update \
    && apt-get -qq install --no-install-recommends -yq -o Dpkg::Options::="--force-confnew" \
    dbus \
    && rm -rf /var/lib/apt/lists/*

Then set up dbus:

RUN mkdir -p /var/run/dbus
ENV DBUS_SESSION_BUS_ADDRESS="$(dbus-uuidgen > /var/lib/dbus/machine-id && dbus-daemon --fork --config-file=/usr/share/dbus-1/session.conf --print-address)"

We still get the dbus errors (eg Failed to connect to the bus: Address does not contain a colon), but the tests have been consistently running without chrome crashing.

We use Chrome 94.0.4606.71 and cypress 9.1.1

There's every chance it's working by coincidence, but thought I'd document it just in case.

tim-sendible avatar Dec 13 '21 11:12 tim-sendible

I’m also running into the same error, on the cypress/browsers:node16.5.0-chrome94-ff93 image, but the tests runs and passes.

However, I was able to get rid of the error by running cypress with the following command:

Xvfb -screen 0 1920x1080x24 :99 & export DISPLAY=:99 && cypress run --browser chrome && pkill Xvfb

I referred to the following.

When running on Linux, Cypress needs an X11 server; https://docs.cypress.io/guides/continuous-integration/introduction#In-Docker

ryichk avatar Dec 14 '21 06:12 ryichk

I am also getting same thing with this docker image FROM cypress/included:9.1.1 [32:1228/173120.027134:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon

bezba avatar Dec 28 '21 17:12 bezba

it seems that this issue is related to chrome https://stackoverflow.com/questions/67627238/issues-with-google-chrome-within-selenium-docker-container

bezba avatar Dec 28 '21 17:12 bezba

downgrading to 8.5.0 and updating my package.json cypress version to 8.5.0 as well, would fix this issue

bezba avatar Dec 28 '21 17:12 bezba

Thanks @ryichk for your solution to combating these error messages - have x-posted this on cypress-io issue #19299.

Would be great to get a proper solution from the Cypress team on that, especially for those using GitHub actions.

giranm avatar Jan 22 '22 23:01 giranm

The dbus errors were resolved with https://github.com/cypress-io/cypress/pull/20939

I was able to run the simple test first mentioned in the included docker container.

I'm assuming something was fixed between when this issue was first logged and now.

mjhenkes avatar Jan 19 '23 21:01 mjhenkes