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

Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory #4925

Closed
fanshyiis opened this issue Aug 5, 2019 · 51 comments

Comments

@fanshyiis
Copy link

When I'm running in a docker environment
When you launch cypress
Always report dbus error
image

@adomyaty55foundry
Copy link

adomyaty55foundry commented Dec 3, 2019

Receiving this issue as well constantly always, I can still use cypress okay but nonetheless the error keeps coming in console

Using WSL 2 (Ubuntu 1804) + mobaXterm (X-Server)

2019-12-03_1449

@jennifer-shehane
Copy link
Member

I'm not entirely sure this is a Cypress issue instead of something isolated to the docker container.

Have you tried our docker images https://github.com/cypress-io/cypress-docker-images or made sure that you have all system dependencies installed required for cypress?

@cypress-bot cypress-bot bot added the stage: awaiting response Potential fix was proposed; awaiting response label Jan 3, 2020
@iperdomo
Copy link

Hi,

You can see the same error in this CI job execution:
https://akvo.semaphoreci.com/jobs/1be15282-d440-40da-9932-7f245d4b48a6#L452

The actual test finished successfully but the dbus error is there.

We're using a container based on the latest cypress/included:3.8.1
https://github.com/akvo/akvo-dockerfiles/blob/9f9bb5317ebbca14972424b074792f9dd0eb785c/lumen-e2e-test/Dockerfile#L3

Any hints are more than welcome

@iperdomo
Copy link

The errors are shown when ELECTRON_ENABLE_LOGGING=true environment variable is set. The tests pass successfully.

A minimum sample system that shows this error. It's using the published Docker image cypress/included:3.8.1

https://github.com/iperdomo/cypress-docker-test

In Cypress documentation site you can find the same error message:

2020-01-11_1399x670_scrot

@iperdomo
Copy link

If you use a Linux host you expose the /var/run/dbus/system_bus_socket socket to the container and the errors go away. Disclaimer: Not entirely sure what security problems this "solution" brings.

See: https://github.com/iperdomo/cypress-docker-test#fixing-the-errors

@jennifer-shehane
Copy link
Member

@iperdomo It also explains in the docs that these errors are fine if Cypress launches successfully.

Note: verbose Electron logging might show warnings that still allow Cypress to work normally. For example, the Cypress Test Runner opens normally despite the scary output below:

Screen Shot 2020-01-13 at 4 01 49 PM

You can safely ignore the dbus error if your tests are executing fine.

@jennifer-shehane jennifer-shehane removed the stage: awaiting response Potential fix was proposed; awaiting response label Jan 13, 2020
iperdomo added a commit to akvo/akvo-lumen that referenced this issue Jan 13, 2020
* We remove the `ELECTRON_ENABLE_LOGGING=true` to avoid a misleading
  dbus error:
  Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

* More info at:
  cypress-io/cypress#4925
tangrammer pushed a commit to akvo/akvo-lumen that referenced this issue Jan 15, 2020
* We remove the `ELECTRON_ENABLE_LOGGING=true` to avoid a misleading
  dbus error:
  Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

* More info at:
  cypress-io/cypress#4925
@matchu
Copy link

matchu commented Apr 16, 2021

In the case of WSL, I think this is because WSL doesn't do any system startup, so there isn't a system dbus process running!

I fixed this by added sudo dbus-daemon --system &> /dev/null to my .bashrc, based on what I found here: microsoft/WSL#2941

@tahv0
Copy link

tahv0 commented Dec 10, 2021

Having this issue. Is @matchu 's solution best or is there a better fix?

@saurabhmehta1601
Copy link

the issue is still persistent . Is there any workaround to get is working . I tried using cypress clean cache and then reinstalling it with yarn but it still shows the same error message 😖

@saurabhmehta1601
Copy link

saurabhmehta1601 commented Dec 14, 2021

Here is some information about my machine 💁‍♂️ :

Node Version : 14.18.2
Yarn Version : 1.22.17
OS: Ubuntu 20.04.3 LTS (Focal Fossa)
Cypress package version: 9.1.1
Cypress binary version: 9.1.1
Electron version: 15.2.0
Bundled Node version: 16.5.0

@dani8art
Copy link

Hi team, happening here as well, both using cypress run and the official docker image:

$ docker run -ti   \
  -v $(pwd)/cypress:/tmp/project   \
  -w /tmp/project   \
  cypress/included:9.1.1
[19:1217/115259.028519: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
[19:1217/115259.032036:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[19:1217/115259.037345:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[178:1217/115259.085612:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is
$ cypress run
It looks like this is your first time using Cypress: 9.1.1

✔  Verified Cypress! /home/vs/.cache/Cypress/9.1.1/Cypress

Opening Cypress...
[194:1217/115424.620771: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
[194:1217/115424.625402:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[194:1217/115424.625457:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[356:1217/115424.656528:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

We have tried to hide those logs without success using what is told in the docs:

$ ELECTRON_ENABLE_LOGGING=false cypress run
[409:1217/120217.982611: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
[409:1217/120217.986901:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[409:1217/120217.986943:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[566:1217/120218.010931:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

It isn't good for us to show logs with an ERROR level so it would be great if the issue is reopened and some investigations are performed. Or maybe there is a safe way to hide those logs.

Thanks in advance.
Don't hesitate to ask for whatever you need, happy to help with it.

@dzschille
Copy link

Same here, with Cypress 9.2 running Chrome 97 headless on Ubuntu 18.04.6, all dependencies installed.

npx cypress run --spec "integration/smoke/*" --config video=false --reporter junit --reporter-options "mochaFile=results/test-output-[hash].xml,toConsole=true" --headless --browser chrome

[32441:0107/132541.367106:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[32441:0107/132541.367258:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[32612:0107/132541.417021:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 

@timwis
Copy link

timwis commented Jan 18, 2022

I'm getting the same error with the basic recommended GitHub Action:

name: Cypress Tests

on: [push]

jobs:
  cypress-run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Cypress run
        uses: cypress-io/github-action@v2
        with:
          build: npm run build
          start: npm start
          browser: chrome
        env:
          MAPBOX_API_KEY: test
> nuxt start

[1734:0118/073854.766031:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[1734:0118/073854.766109:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[1922:0118/073854.781764:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 

@raress96
Copy link

raress96 commented Jan 27, 2022

Same issue as ^ in Github Actions, but I am using the cypress container image:
cypress/browsers:node16.13.0-chrome95-ff94

@nossila
Copy link

nossila commented Feb 14, 2022

Same issue here running on CircleCI with image cypress/base:16.13.2. Also tried with cypress/included:9.4.1 same issue, tests runs fine locally but on CircleCI some tests fail.

@raress96
Copy link

Same issue as ^ in Github Actions, but I am using the cypress container image: cypress/browsers:node16.13.0-chrome95-ff94

Maybe it helps someone, managed to solve the issue by running the application and Cypress tests in a single run section in Github Actions. Not sure why but it worked before even in separate run sections:

      - name: Run App & Cypress
        run: |
          yarn ci-start & # run app in background
          npx -y wait-on DOMAIN_OF_APP --timeout 300000 &&
          yarn cypress:ci

@ShaneHudson
Copy link

After upgrading Cypress I've seen this same issue. It works fine locally but not when running on AWS CodeBuild on their Standard v5 images.

@groovenectar
Copy link

groovenectar commented Mar 1, 2022

Running into this as well. Tests that pass locally fail in Circle CI, intermittently, and also seeing the dbus errors

Edit: If the dbus errors aren't related to intermittent fails, they still raise an eyebrow if anything goes wrong...

@cawoodm
Copy link

cawoodm commented Mar 30, 2022

Any feedback from the cypress devs on what this error actually means?

@PauloFavero
Copy link

I am using docker compose to launch an electron app and I had the same issue.
I fixed it setting ipc: host configuration in my docker-compose.yml.

@nemonemi
Copy link

nemonemi commented Apr 5, 2022

I too am experiencing this issue with v9.1.0.
Could we please re-open this ticket?

Also, it looks related to this one cypress-io/cypress-docker-images#555

@KrishKatamaneni
Copy link

Guess similar issue wit 9.5.3
HomePC:~/work/ucypress$ npx cypress open
[27933:0406/232949.373295: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
[27933:0406/232949.375356:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[27933:0406/232949.375417:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[28132:0406/232949.429745:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is
[27933:0406/232949.538334:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[27933:0406/232949.554525:ERROR:bus.cc(392)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")

@cwveysey
Copy link

cwveysey commented Apr 8, 2022

My Cypress tests pass locally, this issue looks to be preventing my tests from passing via CircleCI...

@qeviking
Copy link

So, this issue is still happening in 2022. I see that this is a "closed" issue, but it is VERY much blocking me. Anyone from the Cypress team want to weigh in?

@kevinjcliao
Copy link

I was unable to get this error message to disappear, which was causing running Cypress in GitLab CI to fail. I love Cypress, but this bug makes it completely unusable for me in continuous integration right now. :(

node:events:504
      throw er; // Unhandled 'error' event
      ^
Error: spawn ps ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn ps',
  path: 'ps',
  spawnargs: [ '-A', '-o', 'ppid,pid,stat,comm' ]
}

@groovenectar
Copy link

https://docs.cypress.io/guides/references/changelog#9-5-4

@nemonemi
Copy link

@groovenectar, what should that link represent? It would be great if you could be a tiny bit more specific.

@groovenectar
Copy link

groovenectar commented Apr 12, 2022

@groovenectar, what should that link represent? It would be great if you could be a tiny bit more specific.

See the first item in the changelog released yesterday:

https://docs.cypress.io/guides/references/changelog#9-5-4

Updates were made to silence Electron warnings related to being unable to connect to dbus. These errors are normal and expected, and do not result in test failures. Because they are always present when running Electron inside docker containers, it has incorrectly led people to believe it is the root-cause of an error within their test run. By silencing these errors, it will improve the debug experience to allow users to focus on meaningful warning and error messages. Fixed #19299.

@ShaneHudson
Copy link

ShaneHudson commented Apr 12, 2022 via email

@groovenectar
Copy link

Do you have any suggestions for how to debug failures on CI that have no trouble locally?

If your application is authenticated, that can get finicky... would double check the sessions and maybe use the experimental session support... be sure the session is validated

Can try increasing timeouts: https://docs.cypress.io/guides/references/configuration#Timeouts

Here are some general troubleshooting tips including specifying the browser: https://docs.cypress.io/guides/references/troubleshooting#Isolate-the-Problem

@jonduarte
Copy link

I was unable to get this error message to disappear, which was causing running Cypress in GitLab CI to fail. I love Cypress, but this bug makes it completely unusable for me in continuous integration right now. :(

node:events:504
      throw er; // Unhandled 'error' event
      ^
Error: spawn ps ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn ps',
  path: 'ps',
  spawnargs: [ '-A', '-o', 'ppid,pid,stat,comm' ]
}

I was having the same issue, and for me, the problem occurred in combination with: start-server-and-test package.
I was using the custom image provided by cypress: cypress/browsers:node14.17.6-chrome100-ff9

After reading this thread: bahmutov/start-server-and-test#132

I created a custom Dockerfile (see below) and I started using it instead, it solved my problem:

FROM cypress/browsers:node14.17.6-chrome100-ff98
RUN apt-get update && apt-get -y install procps

@Yashrocky96
Copy link

I'm facing the same errors but Cypress is executing fine with them on my Jenkins (Running without Dockers) and passing all tests as expected

@ManasPecenek
Copy link

ManasPecenek commented Apr 20, 2022

This solved my problem: mkdir -p /var/run/dbus && dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address. If you are using mac, try this instead mkdir -p /var/run/dbus && dbus-daemon --config-file=/opt/homebrew/share/dbus-1/system.conf --print-address

For details: https://georgik.rocks/how-to-start-d-bus-in-docker-container/

@Zumwaloro
Copy link

Zumwaloro commented Apr 29, 2022

This guide here helped me get rid of the original issue in this thread:

https://docs.cypress.io/guides/getting-started/installing-cypress#Windows-Subsystem-for-Linux

Now I have another issue and I can't seem to find the solution for it.

image

@hutber
Copy link

hutber commented May 29, 2022

If it helps, also having it with WSL and cypress v9.7.0

@repeat
Copy link

repeat commented Jun 11, 2022

I got this issue too, with WSL2, Ubuntu 22.04 LTS, nodejs 16.15.1, npm 8.12.1, cypress 10.1.0.

@2manoj1
Copy link

2manoj1 commented Jun 18, 2022

Failed to connect to the bus: Failed to connect to socket. Getting this error in Gitpod after

# use Cypress provided image with all dependencies included
FROM cypress/included:10.1.0
RUN node --version
RUN npm --version

RUN echo  " node version:    $(node -v) \n" \
    "npm version:     $(npm -v) \n" \
    "yarn version:    $(yarn -v) \n" \
    "debian version:  $(cat /etc/debian_version) \n" \
    "Chrome version:  $(google-chrome --version) \n" \
    "Firefox version: $(firefox --version) \n" \
    "git version:     $(git --version) 

Screenshot 2022-06-18 at 11 58 24 PM

@tertek
Copy link

tertek commented Jul 6, 2022

@Redskinsjo
Copy link

I am running a puppeteer instance on docker and it was failing on launch because of $DISPLAY not set not X server installed. Personally i am on macos but these explanations helped me understand the problem.
However, in puppeteer if you don't need any mouse or keyboard actions, the solution to this failing is to set headless: true

@georgisoft2020
Copy link

For my case, it was caused by the fact that the service was not started.
service dbus start

@shubham-damkondwar
Copy link

I am running a puppeteer instance on docker and it was failing on launch because of $DISPLAY not set not X server installed. Personally i am on macos but these explanations helped me understand the problem. However, in puppeteer if you don't need any mouse or keyboard actions, the solution to this failing is to set headless: true

This was helpful

@henriquecustodia
Copy link

For my case, it was caused by the fact that the service was not started. service dbus start

@georgisoft2020 thanks! It just fixed my problem!

I was tryng to run Cypress 13 with Nx 19 on WLS Ubuntu 22. After facing a lot of errors, this fixed everything:

sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y

Command from https://docs.cypress.io/guides/getting-started/installing-cypress#UbuntuDebian

sudo service dbus start

Starting the dbus service will create the dbus folder and avoid some errors.

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

No branches or pull requests