2e3s / awatcher

Activity and idle watchers
Mozilla Public License 2.0
115 stars 4 forks source link

Watcher "Wayland window (wlr-foreign-toplevel-management-unstable-v1)" cannot run: the requested global was not found in the registry #21

Open luisgerhorst opened 1 month ago

luisgerhorst commented 1 month ago
May 23 13:23:44 luis-tp systemd[2924]: Started aw-awatcher.service.
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.079534 INFO awatcher] Sending to server localhost:5600
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.079594 INFO awatcher] Idle timeout: 180 seconds
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.079608 INFO awatcher] Idle polling period: 5 seconds
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.079621 INFO awatcher] Window polling period: 1 seconds
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.094759 DEBUG watchers::watchers] Watcher "Wayland idle (ext-idle-notify-v1)" cannot run: the requested global was not found in the registry
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.095060 DEBUG watchers::watchers] Watcher "Wayland idle (KDE)" cannot run: the requested global was not found in the registry
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.097072 DEBUG watchers::watchers] Watcher "X11 idle (screensaver)" cannot run: Unsupported extension
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.097109 DEBUG watchers::watchers::gnome_wayland] Gnome Wayland detected
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.098189 DEBUG watchers::watchers] Watcher "Wayland window (wlr-foreign-toplevel-management-unstable-v1)" cannot run: the requested global was not found in the registry
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.101128 DEBUG watchers::watchers] Watcher "KWin window (script)" cannot run: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.102130 DEBUG watchers::watchers] Watcher "X11 window" cannot run: GetPropertyReply[_NET_WM_NAME] failed
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.102163 DEBUG watchers::watchers::gnome_wayland] Gnome Wayland detected
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.105802 INFO watchers::watchers] Selected watcher: Gnome idle (Mutter/IdleMonitor)
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.105837 INFO watchers::watchers] Starting idle watcher
May 23 13:23:44 luis-tp bash[561733]: [2024-05-23 11:23:44.106347 TRACE watchers::watchers::idle] Reporting as not idle
May 23 13:23:49 luis-tp bash[561733]: [2024-05-23 11:23:49.122897 TRACE watchers::watchers::idle] Reporting as not idle
May 23 13:23:54 luis-tp bash[561733]: [2024-05-23 11:23:54.146469 TRACE watchers::watchers::idle] Reporting as not idle
...

When this happens, the window data is missing from ActivityWatch. I am starting awatcher from systemd --user. Restarting awatcher seems to usually resolve this issue.

Version: 0.2.7 (13cea8b, Add timeout to watcher iteration, Debug Build from Source) System: https://github.com/2e3s/awatcher/issues/12#issuecomment-2003103943

2e3s commented 1 month ago

Watcher "Wayland idle (ext-idle-notify-v1)" cannot run: the requested global was not found in the registry

Hello! The debug error like this is expected, it only shows why some watcher is not selected. I don't quite understand why it doesn't output "Selected watcher "Gnome window (extension)" in your case with no other error. Does it happen always, or always when running with systemd, or occasionally (randomly) even with systemd? Have you removed your changes from your branch? I remember adding 3 connection attempts in order to fix the issue with systemd, which happened https://github.com/2e3s/awatcher/issues/8 or https://github.com/2e3s/awatcher/issues/11

luisgerhorst commented 1 month ago

I am running the upstream version 0.2.7, not my branch. Yes, I will investigate when exactly this happens. It seems to occur occasionally with systemd. I have not yet tested how often it occurs with other startup mechanisms on my system.

2e3s commented 1 month ago

If you run the built version and the error happens on system startup, try maybe to increase the number of attempts. If you run a slower machine, it might not be enough on system startup I speculate. Although, the absence of errors in the output is confusing, whatever problem you're facing, I would expect to see at least some errors.

luisgerhorst commented 1 month ago

Has not happend since...