signal-cli icon indicating copy to clipboard operation
signal-cli copied to clipboard

Cannot Resolve Session Bus Address

Open chr1shaefn3r opened this issue 9 years ago • 2 comments

I installed signal-cli as system-bus, which means I installed signal-cli and added a systemd service. The signal.service seams to run fine:

$ systemctl status signal.service
● signal.service - Send secure messages to Signal clients
   Loaded: loaded (/etc/systemd/system/signal.service; enabled)
   Active: active (running) since So 2017-01-22 17:18:51 CET; 24h ago
 Main PID: 24989 (java)
   CGroup: /system.slice/signal.service
           └─24989 java -Xms2m -classpath /opt/signal-cli-0.5.2/lib/signal-cli-0.5.2.jar:/opt/signal-cli-0.5.2/lib/signal-service-java-2.4.2_unofficial_1.jar:/opt/signal-cli-0.5.2/lib/bcprov-jdk15on-1.55.jar:/...

Jan 22 17:18:47  systemd[1]: Starting Send secure messages to Signal clients...
Jan 22 17:18:51  systemd[1]: Started Send secure messages to Signal clients.

I removed the "--config" option from "/etc/systemd/system/signal.service" ExecStart, so that signal-cli would look the config up in "$HOME/.config/signal/data/". Otherwise the installation was done as described in the README. To test it I tried to send a message via dbus like this:

signal-cli --dbus send -m "Ping" <MySignalRegisteredNumber>

But this returns with an error:

org.freedesktop.dbus.exceptions.DBusException: Cannot Resolve Session Bus Address
	at org.freedesktop.dbus.DBusConnection.getConnection(DBusConnection.java:244)
	at org.asamk.signal.Main.handleCommands(Main.java:88)
	at org.asamk.signal.Main.main(Main.java:69)

The failing send doesn't change anything observable with signal.service, the status output is still exactly the same.

Unfortunately I'm very unfamiliar with dbus, so I can't investigate the issue further. If you need any more information don't hesitate to ask.

Cheers, Christoph

chr1shaefn3r avatar Jan 23 '17 16:01 chr1shaefn3r

The dbus system service uses the system dbus. With the --dbus option signal-cli connects to your user's session dbus. Use --dbus-system to connect to the system dbus.

AsamK avatar Jan 24 '17 17:01 AsamK

Works great, thank you very much!

chr1shaefn3r avatar Jan 24 '17 20:01 chr1shaefn3r