pythonseleniumjenkins

What does "Client failed to connect to the D-BUS daemon" mean?


I am using a very complex setup to test various non-public webpages. I use jenkins to run the python-selenium tests within a dockerimage. That way, I am completely independent of the jenkins environment and can create my own environment. In this environment I have the following software installed:

When running the tests, which mostly succeed, I see in the geckodriver.log output messages like

(firefox:55): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
/usr/bin/dbus-launch terminated abnormally without any error message

My questions:


Solution

  • The error you are seeing is :

    (firefox:55): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
    /usr/bin/dbus-launch terminated abnormally without any error message
    

    So it is clear Firefox attempts to connect to D-BUS daemon and fails as dbus-launch gets terminated abnormally.


    dbus-launch

    dbus-launch is basically the utility to start a message bus by firefox through a shell script. It would normally be called from a user's login scripts. dbus-launch launches a session bus instance and print the address and pid of that instance to standard output.

    You can read more about dbus-launch from the Linux man page


    Root Cause

    This error can arise if you use su (root), sudo, suedit, gksu. The main reason is DBUS_SESSION_BUS_ADDRESS retains its value when you su instead of picking up the value in /root/.dbus/session-bus.

    Here you will find a detailed discussion on GConf Error: No D-BUS daemon running?! How to reinstall or fix?.

    Another possible reason may be the base Firefox Browser version may be an older version on which updates were taken to reach the current version.


    Solution :

    There are a couple of solutions available to address this related issue as follows :

    This discussion speaks about the solution in details.


    Best Approach

    The issue with dbus-launch was addressed properly by both Ubuntu and Mozila. To overcome this error you need to follow the below mentioned steps :