Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applet: Handle UnknownObject DBus error. #2499

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tommie
Copy link

@tommie tommie commented Sep 24, 2024

Every 10 s, I see this error, on Ubuntu 24.04.1, which uses Blueman 2.3.5:

 During handling of the above exception, another exception occurred:
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/blueman/main/Applet.py", line 97, in on_device_created
     plugin.on_device_created(path)
   File "/usr/lib/python3/dist-packages/blueman/plugins/applet/RecentConns.py", line 99, in on_device_created
     self._rebuild()
   File "/usr/lib/python3/dist-packages/blueman/plugins/applet/RecentConns.py", line 80, in _rebuild
     self._items = self._get_items()
                   ^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/blueman/plugins/applet/RecentConns.py", line 199, in _get_items
     return sorted(
            ^^^^^^^
   File "/usr/lib/python3/dist-packages/blueman/plugins/applet/RecentConns.py", line 213, in <genexpr>
     if i["adapter"] not in adapter_addresses or self._get_device_path(i["adapter"], i["address"])),
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/blueman/plugins/applet/RecentConns.py", line 193, in _get_device_path
     device = self.parent.Manager.find_device(address, adapter.get_object_path())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/blueman/bluez/Manager.py", line 146, in find_device
     if device['Address'] == address:
        ~~~~~~^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/blueman/bluez/Base.py", line 135, in __getitem__
     return self.get(key)
            ^^^^^^^^^^^^^
   File "/usr/lib/python3/dist-packages/blueman/bluez/Base.py", line 106, in get
     raise parse_dbus_error(e)
 blueman.bluez.errors.BluezDBusException: org.freedesktop.DBus.Error.UnknownObject Method "Get" with signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist

Since there is already exception handling for the adaptor going away (c67ae92), it seems reasonable to add this, in case of devices that "flicker". I can't say for sure why my device is listed by the adapter, but don't actually exist.

(I've also had the applet pinned at 100% CPU, but I think that's a separate issue.)

Copy link

sonarcloud bot commented Sep 24, 2024

@infirit
Copy link
Contributor

infirit commented Sep 25, 2024

We should handle this error but I want to know why/how you got into this loop. Recentconns is notified of a new device which it may or may not know and tries to rebuild it's menu. It fails because the just created device doesn't exist anymore, which I find a little unusual.

Can you kill blueman-applet and run it from a terminal with blueman-applet --debug and let it log for a couple of minutes minute while this is going on and post/link it here?

@tommie
Copy link
Author

tommie commented Sep 25, 2024

I'll try to do that. This triggers very rarely, probably around suspend/resume. When it happens, it gets stuck repeating the same error every 10 s.

@infirit
Copy link
Contributor

infirit commented Sep 26, 2024

If it happens with suspend/resume it might be the adapter isn't restoring it's state properly on resume. Kernel log may also provide some clues then.

Copy link
Contributor

@infirit infirit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is fine. If you do find the time to get some logs I would still like to see them.

@tommie
Copy link
Author

tommie commented Oct 6, 2024

Thanks. :)

I've actually been running an unpatched Blueman since we last spoke, but haven't been able to trigger it. I only suspend 1-2 times a day, though. I'll get back to you when it happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants