Unable to open the session message bus

Asked by Omadas on 2014-12-08

When opening Haguichi, I am prompted to authenticate to run '/bin/systemctl' as the super user. After I do this, the system gives an 'Error connecting' with no output.

Here is the output from the terminal however: 'Failed to get D-Bus connection: No connection to service manager.'

Tried to run haguichi from terminal with gksu provided this:
[ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: Unable to open the session message bus. ---> System.ArgumentNullException: Argument cannot be null.
Parameter name: address
  at NDesk.DBus.Bus.Open (System.String address) [0x00000] in <filename unknown>:0
  at NDesk.DBus.Bus.get_Session () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at NDesk.DBus.Bus.get_Session () [0x00000] in <filename unknown>:0
  at NDesk.DBus.BusG.Init () [0x00000] in <filename unknown>:0
  at Platform.Init () [0x00000] in <filename unknown>:0
  at Haguichi.Main (System.String[] args) [0x00000] in <filename unknown>:0

This computer has been updated to each new release since 12.10, so it may be time to do a clean reinstall soon. But I will follow-thru with this bug report in case others are having similar problems. I followed other solutions for Haguichi including modifying the sudoers file to by-pass the prompt asking for the super user password. This didn't fix my problem. I dug a little deeper: To my knowledge Ubuntu uses upstart, so my surprise when i ran :~$ findmnt | grep /sys/fs/cgroup

│ ├─/sys/fs/cgroup none tmpfs rw,relatime,size=4k,mode=755
│ │ └─/sys/fs/cgroup/systemd systemd cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/run/cgmanager/agents/cgm-release-agent.systemd,name=systemd

I found Systemd!!! No problem with my Kernal uname -r gives '3.16.0-25-generic'

I do not know if this is related to Haguichi being 'Unable to open the session message bus.', or if I need to mark another package for this bug and not Haguichi.

Question information

Language:
English Edit question
Status:
Solved
For:
Haguichi Edit question
Assignee:
No assignee Edit question
Solved by:
Omadas
Solved:
2015-07-07
Last query:
2015-07-07
Last reply:
2014-12-08
Stephen Brandt (ztefn) said : #1

Hi Omadas,

Ubuntu normally uses upstart indeed, so having systemd installed is quite strange.

D-Bus is a inter-process communication system [1] which should be initiated at startup, by either upstart or systemd. So these problems are likely to be related to one another. Also, I would suspect that more applications than just Haguichi are unable to start without D-Bus.

I've searched a bit for the messages you received and found this similar report [2]. Maybe you can find some helpfull information in there.

[1] http://en.wikipedia.org/wiki/D-Bus
[2] https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1387241

Omadas (bsperger) said : #2

Followed up with your second link, and marked that bug as confirmed. Since it affects your project I will keep you informed as I can. This only happened as I said, after upgrading to 14.10. We will see what happens, in the mean time I will leave this marked as answered since the problem does not seem to be Haguichi. Thanks for a great program, and hopefully we can get it working for everyone again.

Stephen Brandt (ztefn) said : #3

While reading back I noticed you run Haguichi with gksu when you got the exception error. This is expected because the root account doesn't have any (D-Bus) session. Haguichi itself should always be run under your normal user account.

This leaves you just with a '/bin/systemctl' which doesn't work. And when systemctl is present Haguichi assumes it should be used to start the Hamachi daemon. So I guess either systemctl (systemd) should be uninstalled or somehow be configured to actually work.

As a workaround you can start the Hamachi deamon manually via upstart before running Haguichi, using "sudo service logmein-hamachi start".

Omadas (bsperger) said : #4

Thanks! I will forward that workaround onto Bug #1387241, the one you linked me to as a temporary workaround for affected packages or until someone tells me to simply remove systemd or if the configuration needs to be corrected.

Omadas (bsperger) said : #5

Your work around works. Thanks for that and the heads-up on the improper handling on gksu, It never occurred to me that root would not have all of the services available to it.

Omadas (bsperger) said : #6

Officially:
"For 15.04 we plan to change to systemd by default, at which point this will work. For 14.10 making systemctl "invisible" is not an important enough issue to warrant a stable release update; plus, some people actually want to boot 14.10 with systemd for experimentation (note that this is not officially supported, and some things are known not to work)."

They have not confirmed if systemd can be removed safely for the time being. If users want a one click option they can create a short cut for haguichi and pin it to their unity launcher for the time being. Note, this method will require the administrative password.

The short cut will need to be edited in your favorite editor (gedit for me.):

[Desktop Entry]
Version=1.0
Type=Application
Icon=/usr/share/icons/hicolor/64x64/apps/haguichi.png
Name=Haguichi
Hidden=false
Terminal=false
Exec=bash -c "gksu service logmein-hamachi start && haguichi &"
TargetEnvironment=Unity

Omadas (bsperger) said : #7

Fixed with 15.04 Update.