dbus-broker icon indicating copy to clipboard operation
dbus-broker copied to clipboard

RFE: add destination/unit name to error messages

Open jakedane opened this issue 5 months ago • 5 comments

I'm using dbus-broker 35 on Arch Linux. I think it will be useful for troubleshooting if error messages include the destination/unit name the error is for. Currently dbus-broker does not include that.

For example if a destination is not found (https://github.com/bus1/dbus-broker/blob/main/src/bus/driver.c#L2794) dbus-broker has a Destination does not exist error message that does not include what the destination was. It's not logged elsewhere in the journal either. When using dbus-daemon the error message does include what the destination was:

# dbus-broker
gnome-shell[1216]: Failed to make thread 'KMS thread' realtime scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Destination does not exist

# dbus-daemon
gnome-shell[1229]: Failed to make thread 'KMS thread' realtime scheduled: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Name "org.freedesktop.RealtimeKit1" does not exist

Or for example when an activation fails because a unit is unknown (https://github.com/bus1/dbus-broker/blob/main/src/launch/service.c#L367) dbus-broker has a activation request failed: unknown unit error message that does not include the unit name. It is logged elsewhere in the journal (2 seconds earlier in my example) but there's no way to relate the journal entries that I can see. When using dbus-daemon the error message does include what the unit name was, compare the pulseaudio line for dbus-broker and dbus-daemon:

# dbus-broker
dbus-broker-launch[1108]: Activation request for 'org.bluez' failed: The systemd unit 'dbus-org.bluez.service' could not be found.
[+2s]
pulseaudio[2354]: GetManagedObjects() failed: org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer: activation request failed: unknown unit.

# dbus-daemon
dbus-daemon[1126]: [system] Activating via systemd: service name='org.bluez' unit='dbus-org.bluez.service' requested by ':1.91' (uid=1000 pid=2369 comm="/usr/bin/pulseaudio --daemonize=no --log-target=jo")
dbus-daemon[1126]: [system] Activation via systemd failed for unit 'dbus-org.bluez.service': Unit dbus-org.bluez.service not found.
pulseaudio[2369]: GetManagedObjects() failed: org.freedesktop.systemd1.NoSuchUnit: Unit dbus-org.bluez.service not found.

If the error message sent back would include the destination/unit name similar to how dbus-daemon does that, I think that helps users trying to troubleshoot an issue on their system.

jakedane avatar Jan 10 '24 09:01 jakedane