Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

CRITICAL : unhandled exception (type Glib::Error) in signal handler g-dbus-error-quark

Open ashish-kus opened this issue 1 year ago • 7 comments

everyrime i run waybar on terminal everything work fine but I see these error in std output

** (waybar:22634): CRITICAL **: 19:07:05.895:
unhandled exception (type Glib::Error) in signal handler:
domain: g-dbus-error-quark
code  : 41
what  : GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/login1/session/self'.

config: https://0x0.st/XZ0F.json

ashish-kus avatar May 26 '24 13:05 ashish-kus

Same issue. Appeared after I added the "backlight/slider" module.

shimeoki avatar May 31 '24 19:05 shimeoki

I did some investigation here, I'm not sure of my findings.

I think this error is not causing anything bad, it's just that Waybar tries to connect to the wrong dbus login session. According to the following output, there is no /org/freedesktop/login1/session/self. Instead there is a /org/freedesktop/login1/session/auto:

$ busctl tree org.freedesktop.login1
└─ /org
  └─ /org/freedesktop
    ├─ /org/freedesktop/LogControl1
    └─ /org/freedesktop/login1
      ├─ /org/freedesktop/login1/seat
      │ ├─ /org/freedesktop/login1/seat/auto
      │ └─ /org/freedesktop/login1/seat/seat0
      ├─ /org/freedesktop/login1/session
      │ ├─ /org/freedesktop/login1/session/_33
      │ ├─ /org/freedesktop/login1/session/_34
      │ └─ /org/freedesktop/login1/session/auto
      └─ /org/freedesktop/login1/user
        ├─ /org/freedesktop/login1/user/_1000
        └─ /org/freedesktop/login1/user/self

I recompiled Waybar changing that:

--- a/src/util/backlight_backend.cpp
+++ b/src/util/backlight_backend.cpp
@@ -153,7 +153,7 @@ BacklightBackend::BacklightBackend(std::chrono::milliseconds interval,
   // Connect to the login interface
   login_proxy_ = Gio::DBus::Proxy::create_for_bus_sync(
       Gio::DBus::BusType::BUS_TYPE_SYSTEM, "org.freedesktop.login1",
-      "/org/freedesktop/login1/session/self", "org.freedesktop.login1.Session");
+      "/org/freedesktop/login1/session/auto", "org.freedesktop.login1.Session");

and the error disappears. I'm not 100% what this all means, tried reading the documentation but didn't understand anything :slightly_smiling_face:

This was introduced in e8c4b85328f6fb6b8a250db6709595af6cca3bfb so paging @Kuruyia as author of the original patch. Do you have any thoughts here on how DBus works?

By the way, this issue is maybe related to #3042 (at least for the errors dumped on console)

apiraino avatar Jul 06 '24 18:07 apiraino

This was introduced in https://github.com/Alexays/Waybar/commit/e8c4b85328f6fb6b8a250db6709595af6cca3bfb so paging @Kuruyia as author of the original patch. Do you have any thoughts here on how DBus works?

I'm not 100% sure, but from what I understand from systemd-logind's code, you can indeed not have the /org/freedesktop/login1/session/self node and have the /org/freedesktop/login1/session/auto node in some case. So I think your patch of using /auto is very reasonable.

I'm curious as to what environment you are running? I took a look at elogind's code too, but there are no differences with the function in systemd-logind.

Kuruyia avatar Jul 08 '24 13:07 Kuruyia

hey @Kuruyia thank you so much for pointing to the systemd codebase! Yes, by reading the commit message, I now get a bit more context and though the wording is not 100% clear to me, it sounds like "auto" is some sort of fallback.

Can't speak for OP but I am on debian/trixie with latest systemd 256.1. My login manager is not elogind, I am using greetd with Sway.

apiraino avatar Jul 08 '24 14:07 apiraino

hey @Kuruyia thank you so much for pointing to the systemd codebase! Yes, by reading the commit message, I now get a bit more context and though the wording is not 100% clear to me, it sounds like "auto" is some sort of fallback.

Oh good idea reading the commit message, didn't think about that x) Yeah it seems to say that if we don't care about sessions, we can simply use the /auto node. If you want to open a PR to fix this it would be cool ^^ We can also try to open /auto first and fallback to /self if this failed (in case we encounter an old or odd login manager).

Can't speak for OP but I am on debian/trixie with latest systemd 256.1. My login manager is not elogind, I am using greetd with Sway.

Ohhh okay didn't know about this one. Although is it greetd that exposes the org.freedesktop.login1 interface on your system? I don't see any D-Bus related code in the greetd repo.

Kuruyia avatar Jul 08 '24 16:07 Kuruyia

I'm facing the same issue. Is there any workaround that doesn't involve editing the source code and recompiling locally?

5han7anu-S avatar Aug 07 '24 23:08 5han7anu-S

Same here, but with me is only happening, as far as I could understand, when I restart waybar with killall -SIGUSR2 waybar or a "complete" kill killall waybar; waybar -c ~/.config/hypr/waybar/config -s ~/.config/hypr/waybar/style.css & disown. Only works again by loging out of Hyrpeland and loging back in.

 .821ns fsh ❯ 
** (waybar:10720): CRITICAL **: 10:01:38.820: 
unhandled exception (type Glib::Error) in signal handler:
domain: g-dbus-error-quark
code  : 41
what  : GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/login1/session/self'.


** (waybar:10720): CRITICAL **: 10:01:39.271: 
unhandled exception (type Glib::Error) in signal handler:
domain: g-dbus-error-quark
code  : 41
what  : GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/login1/session/self'.


** (waybar:10720): CRITICAL **: 10:01:39.475: 
unhandled exception (type Glib::Error) in signal handler:
domain: g-dbus-error-quark
code  : 41
what  : GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/login1/session/self'.


** (waybar:10720): CRITICAL **: 10:01:40.273: 
unhandled exception (type Glib::Error) in signal handler:
domain: g-dbus-error-quark
code  : 41

msmafra avatar Sep 23 '24 13:09 msmafra

This issue seems to be the same as #3042 And I receive the error every time I try to change my display brightness using the brightness or brightness/slider module. brightnessctl set x% works as expected, and the value updates on the waybar module, but altering the value using the waybar module itself is impossible

IBeTheBlueCat avatar Oct 24 '24 11:10 IBeTheBlueCat

For my environment in Hyprland, I have to run waybar from Hyprland with hyprctl dispatch exec waybar and these problems go away.

demonspork avatar Nov 11 '24 04:11 demonspork

This issue seems to be the same as #3042 And I receive the error every time I try to change my display brightness using the brightness or brightness/slider module. brightnessctl set x% works as expected, and the value updates on the waybar module, but altering the value using the waybar module itself is impossible

I also faced this problem when I try to use slider to adjust my backlight and it doesn't work. The brightnessctl set works normally and I use waybar-git in Archlinux(re-installed today).

Nambers avatar Dec 02 '24 21:12 Nambers

For my environment in Hyprland, I have to run waybar from Hyprland with hyprctl dispatch exec waybar and these problems go away.

Thank you for bringing this up, the brightness module does work correctly and no errors are thrown when running from hyprctl or just by running waybar in a terminal. This error seems to be exclusive to running waybar with systemd --user start waybar, which is how I prefer to do it for my config.

IBeTheBlueCat avatar Dec 02 '24 23:12 IBeTheBlueCat

For my environment in Hyprland, I have to run waybar from Hyprland with hyprctl dispatch exec waybar and these problems go away.

sadly this didn't works on my side I used

hyprctl dispatch exec "waybar -c ~/.config/waybar/waybar.conf"

(ps I didn't get any log in stdout) and I was started waybar from exec-once

edit: for terminal, I got

** (waybar:17441): CRITICAL **: 17:43:26.668: 
unhandled exception (type Glib::Error) in signal handler:
domain: g-dbus-error-quark
code  : 41
what  : GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/login1/session/self'.

Nambers avatar Dec 02 '24 23:12 Nambers

For me it solved that issue with hyprctl dispatch exec, but I use hyprctl dispatch -- exec waybar -c ~/config -s ~/style https://wiki.hyprland.org/Configuring/Using-hyprctl/#dispatch

Won't work for long lines. At least did not work for me with nwg-drawer's long lines.

msmafra avatar Dec 03 '24 00:12 msmafra

According to PR#3808, this issue should have been fixed. However, I am still experiencing the problem and I don’t understand why the backlight and backlight/slider modules are not working.

When I run Waybar in kitty, I get the following error:

** (waybar:5901): CRITICAL **: 23:13:36.466: 
unhandled exception (type Glib::Error) in signal handler:
domain: g-dbus-error-quark
code  : 41
what  : GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/login1/session/self'.

The output of busctl tree org.freedesktop.login1 is:

└─ /org
  └─ /org/freedesktop
    ├─ /org/freedesktop/LogControl1
    └─ /org/freedesktop/login1
      ├─ /org/freedesktop/login1/seat
      │ ├─ /org/freedesktop/login1/seat/auto
      │ └─ /org/freedesktop/login1/seat/seat0
      ├─ /org/freedesktop/login1/session
      │ ├─ /org/freedesktop/login1/session/_32
      │ ├─ /org/freedesktop/login1/session/_33
      │ └─ /org/freedesktop/login1/session/auto
      └─ /org/freedesktop/login1/user
        ├─ /org/freedesktop/login1/user/_1000
        └─ /org/freedesktop/login1/user/self

My backlight configuration is as follows:

"backlight": {
	"device": "amdgpu_bl1",
	"interval": 2,
	"align": 0,
	"rotate": 0,
	"format-icons": [
		" ",
		" ",
		" ",
		"󰃝 ",
		"󰃞 ",
		"󰃟 ",
		"󰃠 "
	],
	"format": "{icon}",
	"tooltip-format": "backlight {percent}%",
	"icon-size": 10,
	"on-click": "brightnessctl set 1-",
	"on-click-middle": "brightnessctl set 1-",
	"on-click-right": "brightnessctl set 1-",
	"on-update": "",
	"on-scroll-up": "brightnessctl set 1+",
	"on-scroll-down": "brightnessctl set 1-",
	"smooth-scrolling-threshold": 1
}

Despite trying scrolling/slider gestures, clicking, and even executing hyprctl dispatch exec waybar, I still encounter the same error in kitty. How can I fix this issue?

P.S. Some additional information:

  • Normally, the command ls /sys/class/backlight displays amdgpu_bl1 most of the time, but occasionally it shows amdgpu_bl2. Neither module works, whether I leave the device parameter unset or specify it explicitly.
  • Waybar v0.11.0
  • Hyprland 0.47.2
  • Login with uwsm 0.20.5
  • Arch Linux

manhtq0508 avatar Feb 11 '25 16:02 manhtq0508