dbus does not start automatically in Hardy

Bug #207157 reported by Pat Double
20
Affects Status Importance Assigned to Milestone
beagle (Ubuntu)
Won't Fix
Undecided
Unassigned
dbus (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

(read below: the original problem is caused by dbus not running)

Binary package hint: beagle

It appears that something is inconsistent with dbus and beagle. Beagle is using dbus to detect the battery status but it cannot. I get the following log messages when starting beagle. I am using Hardy Beta with packages updated to the latest as of 26 March 2008, morning, CST6CDT.

Description: Ubuntu hardy (development branch)
Release: 8.04

20080326 09:26:54.0089 13200 Beagle INFO: Starting Beagle Daemon (version 0.3.3)
20080326 09:26:54.6157 13200 Beagle INFO: Running on Mono 1.2.6
20080326 09:26:54.6162 13200 Beagle INFO: Command Line: /usr/lib/beagle/BeagleDaemon.exe --replace --bg
20080326 09:26:54.6610 13200 Beagle WARN: Extended attributes are not supported on this filesystem. Performance will suffer as a result.
20080326 09:27:17.1678 13200 Beagle ERROR EX: Failed to access dbus session bus. Battery monitoring will be disabled.
20080326 09:27:17.1678 13200 Beagle ERROR EX: System.Exception: Unable to open the session message bus. ---> System.ArgumentNullException: Argument cannot be null.
20080326 09:27:17.1678 13200 Beagle ERROR EX: Parameter name: address
20080326 09:27:17.1678 13200 Beagle ERROR EX: at NDesk.DBus.Bus.Open (System.String address) [0x00000]
20080326 09:27:17.1678 13200 Beagle ERROR EX: at NDesk.DBus.Bus.get_Session () [0x00000] --- End of inner exception stack trace ---
20080326 09:27:17.1678 13200 Beagle ERROR EX:
20080326 09:27:17.1678 13200 Beagle ERROR EX: at NDesk.DBus.Bus.get_Session () [0x00000]
20080326 09:27:17.1678 13200 Beagle ERROR EX: at NDesk.DBus.BusG.Init () [0x00000]
20080326 09:27:17.1678 13200 Beagle ERROR EX: at Beagle.Daemon.BatteryMonitor.Init () [0x00000]

Revision history for this message
dBera (dbera-web) wrote :

Do you have DBUS_SESSION_BUS_ADDRESS set ? and dbus running ?

Revision history for this message
Pat Double (patdouble) wrote :

$ ps -ef | grep dbus
105 6867 1 0 09:25 ? 00:00:18 /usr/bin/dbus-daemon --system
double 13168 1 0 09:26 ? 00:00:00 dbus-launch --autolaunch 1311ebc9218d019ddfb43e004733c7b3 --binary-syntax --close-stderr
double 13169 1 0 09:26 ? 00:00:00 /usr/bin/dbus-daemon --fork --print-pid 7 --print-address 9 --session

$ echo $DBUS_SESSION_BUS_ADDRESS

Looks like "Yes" to dbus running, "No" to DBUS_SESSION_BUS_ADDRESS set.

Revision history for this message
dBera (dbera-web) wrote :

Well ... dbus session bus address has to be set for any application to contact dbus. Could be a hardy error. BTW, if you log in via ssh, then dbus session is not set and you have to set it manually.

Revision history for this message
Pat Double (patdouble) wrote :

I am logging in using kdm (KDE 3.5.9). I have not modified anything in the system config or such that I think would break this. I did upgrade from Gutsy, this is not a Hardy install from scratch.

Revision history for this message
dBera (dbera-web) wrote :

Then its a kdm bug. dbus-launch (or dbus-daemon --session, IIRC) is supposed to export that environment variable. KDE does not use a lot of dbus otherwise you would have noticed it somewhere else too.

Revision history for this message
Pat Double (patdouble) wrote :

The attached file will fix this when placed into /etc/X11/Xsession.d/15dbus

Revision history for this message
dBera (dbera-web) wrote :

Shouldnt this be filed with X for this to get fixed ?

Revision history for this message
Pat Double (patdouble) wrote :

I am not sure which package really. I added dbus, I hope that is correct.

Revision history for this message
dBera (dbera-web) wrote :

Ok - I changed the subject of the bug to reflect the true reason; this should get the required attention. I still believe its some bug in your system; this is too major a bug to go unnoticed.

description: updated
Revision history for this message
John Cooper (choffee) wrote :

This was removed in the last version of dbus ( 1.1.20-1ubuntu1 )

From the Change log:
     - debian/rules: Do not install /etc/X11/Xsession.d/75dbus_dbus-launch, we
      do not need it for Gnome, KDE, and XFCE, and it causes trouble.
      (LP #62163)
    - debian/dbus.preinst: Remove obsolete conffile
      /etc/X11/Xsession.d/75dbus_dbus-launch on upgrades. This needs to be
      kept until after Hardy's release.

I think you need to add the following to your .xsession if you are not using KDE,Gnome or XFCE

if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
 ## if not found, launch a new one
 eval `/usr/bin/dbus-launch --sh-syntax --exit-with-session`
fi

Revision history for this message
Pat Double (patdouble) wrote :

I am using KDE 3.5.9. Do you know why the problem with beagle occurs? It seems that it should not.

Revision history for this message
dBera (dbera-web) wrote :

Possibly some missing package or incorrect dependency; as a result of which whatever is starting dbus for you is not exporting the required environment variable DBUS_SESSION_BUS_ADDRESS (this variable is not required by only beagle; it is must available feature of dbus)

Revision history for this message
Pat Double (patdouble) wrote :

I performed a fresh install of Kubuntu 8.04 and beagle as follows:

1. Install Kubuntu 8.04 Beta desktop CD to a clean hard drive.
2. Use Adept to perform all updates with default repos.
3. Install package "beagle".

Upon login to my KDE session the beagle log shows the same error. The dbus address variable is not defined.

Am I correct in assuming that installing beagle and using KDE is a valid use case and this should be fixed? It seems my above test shows it is not a misconfiguration specific to my install.

Revision history for this message
dBera (dbera-web) wrote :

As mentioned in the comments of LP #62163, you might have to install dbus-x11 and restart kdm.

Revision history for this message
Pat Double (patdouble) wrote :

I already have dbus-x11 installed. It provides /usr/bin/dbus-launch which is in the process list when beagle starts, but apparently it doesn't do what it is supposed to do.

Revision history for this message
marcmpub (marcmpub) wrote :

thanks to John cooper whot trigered my interest on that bug report, creating the xsession.d file on my kubuntu hardy beta 64 system according ot his recommandation helped me to make possible the start of f-spot. Again thanks , just wondering if that won't create a conflict....?

Revision history for this message
Pat Double (patdouble) wrote :

Note that although dbus-x11 is installed in my desktop, my test with a fresh Kubuntu install and beagle did not include dbus-x11 as a dependancy. I think at least beagle should depend on dbus-x11. Still doesn't solve the problem though.

@marcmpub
I do not know if this will cause a conflict. The script was removed from dbus for a good reason I'm sure.

Revision history for this message
laryy (maciej-zubala) wrote :

I got the same problem in kubuntu gutsy after some updates I guess. dbus does not start automatically and therefore I do not have network manager running and no network available. I have to start dbus manually then run dhcp client to get connected. Does any one know how to fix that ?

Revision history for this message
dBera (dbera-web) wrote :

"dbus not starting by default in KDE" - isnt this some kind of major bug ?

"importance" is still undecided and no one seems to care about this problem. What is the ubuntu way to at least mark a bug as "confirmed" ? Can users mark it as "confirmed" ?

Revision history for this message
Vladimir Prus (vladimir-prus) wrote :

I'm not exactly sure why this DBUS_SESSION_BUS_ADDRESS is not necessary when running Kubuntu 8.04 (KDE 3.5 session), but it breaks all KDE4 application when they are built from source. In fact, Qt4's qdbusviewer already cannot connect to session bus, and all KDE4 applications cannot connect either.

Revision history for this message
Gotisch (gotisch) wrote :

I have the same problem with fresh xubuntu install. noticed it when using hipo to manage my ipod. This really is a serious bug imo, since it breaks all applications that need dbus

Changed in beagle:
status: New → Confirmed
Changed in dbus:
status: New → Confirmed
Revision history for this message
Gotisch (gotisch) wrote :

Actually i played around a bit with /etc/xdg/xfce4/xinitrc
where it actually loads dbus-launch.

although i noticed this file doesnt even get executed when i login to xubuntu. If at login i choose xfce-session however it gets executed and all dbus related software works ( i however edited my xinitrc a bit, can anyone test this with a non edited one? so just choosing xfce-session at login screen instead of the "standard" "Run Xclient script").

i dont really know what the difference between xfce-session and "Run Xclient script" is since all docs about xclient script just say that it tries to load Xsession files. don't know if xfce-session doesnt do it or what.

Revision history for this message
Gotisch (gotisch) wrote :

well just tested both and it seems, xfce-session runs Xsession.d files too... but "Run Xclient script" doesnt run /etc/xdg/xfce4/xinitrc.

dont really know what other files Run Xclient script starts though.

Revision history for this message
Diaa Sami (diaa.sami) wrote :

I'd like to mention that I faced a lot of problems because the dbus address env variable wasn't defined, my setup is as follows:
I installed Ubuntu Gutsy on my machine then I upgraded to Hardy, everything was going fine then I switched to KDE and made it the default, note that I had dbus-x11 already installed, this is when I started getting problems, I get random pauses in mplayer and an error message on totem startup in addition to a significant slowdown when showing GTK file dialogs, later I figured out all these are related to D-BUS, when I checked mplayer output I found that the random pauses are in sync with the following error message:
Message: Failed to connect to the D-BUS daemon
and the error message on totem startup was:
Unable to activate plugin Media Player Keys
A search on the web showed that this is related in someway or another to D-BUS

All of these problems in addition to the significant slowdown when showing GTK file dialogs disappeared after using the solution by Pat Double (https://bugs.launchpad.net/ubuntu/+source/dbus/+bug/207157/comments/6)

Revision history for this message
Candle Jack (c-c-c-c-c-c-c-c-c-combobreaker) wrote :

This bug is related to at least two others:
https://bugs.launchpad.net/ubuntu/+source/f-spot/+bug/185752
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/239551

I can confirm Diaa Sami's observation that GTK file dialog slowdown is gone with DBUS_SESSION_BUS_ADDRESS properly exported.

Pat Double's Xsession is effective, but this needs to actually be fixed. Seems like this should be marked of medium or higher importance, since it cripples many important tools.

Revision history for this message
dBera (dbera-web) wrote :

I checked with the dbus-x11 package in other distributions. They contain an xinit startup script which starts dbus with X. I couldnt check the contents of the dbus-x11 in hardy, but others are installing dbus-x11 to fix this problem. Of course the relevant apps need to also depend on dbus-x11.

Revision history for this message
dBera (dbera-web) wrote :

Here is the startup script in the recent debian dbus-x11 package:

/etc/X11/Xsession.d/75dbus_dbus-launch
...

(from http://packages.debian.org/sid/i386/dbus-x11/filelist)

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

We solved this in later releases, in hardy it's up to the session manager to get this right though

Changed in dbus (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Jeremy Bícha (jbicha) wrote :

Thank you for taking the time to report this bug. We are sorry that we do not always have the capacity to look at all reported bugs in a timely manner.

Beagle, the search software, is no longer included in Ubuntu. Unrelated genetic analysis software named beagle has now been uploaded to Ubuntu's archives for the next version of Ubuntu. Therefore, to avoid confusion, I am closing this bug.

Changed in beagle (Ubuntu):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.