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

Activating the Hamster plugin without Hamster present (or missing permissions in Flatpak) will cause tracebacks on startup, crashing / preventing GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown #683

Closed
jorgeecardona opened this issue Jun 7, 2021 · 8 comments · Fixed by #1121
Labels
bug packaging Flatpak packages (anything else = NOPE.png) plugins Plugins and extra backends priority:critical reproducible-in-git Issues that affect the current dev version

Comments

@jorgeecardona
Copy link

jorgeecardona commented Jun 7, 2021

Hi, I have installed GTG 0.5 via flapak, I am getting the following error the first time I run the app with flatpak run org.gnome.GTG

Traceback (most recent call last):
  File "/app/lib/python3.8/site-packages/dbus/bus.py", line 175, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/app/lib/python3.8/site-packages/dbus/bus.py", line 359, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/app/lib/python3.8/site-packages/dbus/connection.py", line 650, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: org.freedesktop.DBus.Error.NameHasNoOwner

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/lib/python3.8/site-packages/GTG/gtk/application.py", line 123, in do_activate
    self.init_shared()
  File "/app/lib/python3.8/site-packages/GTG/gtk/application.py", line 162, in init_shared
    self.init_plugin_engine()
  File "/app/lib/python3.8/site-packages/GTG/gtk/application.py", line 188, in init_plugin_engine
    self.plugin_engine.activate_plugins()
  File "/app/lib/python3.8/site-packages/GTG/core/plugins/engine.py", line 201, in activate_plugins
    plugin.instance.activate(api)
  File "/app/lib/python3.8/site-packages/GTG/plugins/hamster/hamster.py", line 155, in activate
    self.hamster = dbus.SessionBus().get_object('org.gnome.Hamster',
  File "/app/lib/python3.8/site-packages/dbus/bus.py", line 239, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/app/lib/python3.8/site-packages/dbus/proxies.py", line 248, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/app/lib/python3.8/site-packages/dbus/bus.py", line 180, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/app/lib/python3.8/site-packages/dbus/bus.py", line 275, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/app/lib/python3.8/site-packages/dbus/connection.py", line 650, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown

This happen the first time I run the app, if I use a different console to run the app it opens without the error. The same happen if I click in the app's icon, the first time gnome just wait for the app to open but no window shows up, if I click again in the icon then the window shows up properly.

I have a GNOME Shell 3.38.4 on a Debian sid. Let me know if you need more info.

@nekohayo
Copy link
Member

Huh, this is odd... I have no idea what this might mean, and I haven't encountered that (apparently others didn't either). Is that still happening consistently for you, or did you just happen to have a broken d-bus on that particular day that got fixed by a reboot?

@nekohayo nekohayo added needinfo We need more info to solve the issue, or we can't fix it. packaging Flatpak packages (anything else = NOPE.png) labels Jul 11, 2021
@jorgeecardona
Copy link
Author

It happens consistently; my current gnome installation runs flawlessly, this is the only thing failing at the moment. I can give you versions of installed packages or content of files on request.

@Neui
Copy link
Contributor

Neui commented Jul 12, 2021

It seems to be caused by the Hamster plugin. Since it says "ServiceUnknown" I guess you don't have Hamster installed. That it shouldn't block the execution is a bug in my opinion. Try disabling the plugin/extension.

@nekohayo nekohayo added bug plugins Plugins and extra backends priority:high reproducible-in-git Issues that affect the current dev version and removed needinfo We need more info to solve the issue, or we can't fix it. packaging Flatpak packages (anything else = NOPE.png) labels Feb 19, 2022
@nekohayo nekohayo changed the title DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Activating the Hamster plugin without Hamster present will cause tracebacks, and will prevent GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Feb 19, 2022
@nekohayo
Copy link
Member

nekohayo commented Feb 19, 2022

Aaah, I can indeed reproduce this now, so retitling this ticket for clarity. The trick is to try to activate the plugin without Hamster present on your system. When you do that, you'll get a traceback (that gets caught by the new ErrorPopup module and traceback handler GUI), which appears non-fatal at first, but the next time you try to launch GTG it will turn into a fatal traceback that prevents launch, with output exactly as @jorgeecardona reported above. So perhaps this is a bug @flavin could help with!

The workaround, if any user is encountering this problem for the time being, is to edit the gtg.conf file in the config directory, and remove "hamster" from the activated plugins list.

@nekohayo
Copy link
Member

nekohayo commented Feb 19, 2022

As an additional note: GTG should also probably have a defensive plugin mechanism that doesn't save the activation state of plugins if an error occurs while trying to activate them, but I don't know how hard that would be to accomplish (or maybe it's just a matter of putting the whole plugin activation call into a giant try-except catch to avoid writing that config when any exception occurs)...

@idle5
Copy link

idle5 commented Jun 5, 2022

Not sure if this is a related issue to the one above or I should open a new issue, but I recently downloaded the program from Flathub (6/5/22) as well as plugin dependencies and i'm getting a similar issue when trying to enable Hamster time tracking integration after going to options -> plugins. I also tried to see if maybe the Hamster plugin was enabled in the .conf file but it isn't. Any help would be appreciated! Thank you.
Here is the error:

Context: Global generic exception

Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/app/lib/python3.9/site-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/app/lib/python3.9/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: org.freedesktop.DBus.Error.NameHasNoOwner

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/GTG/gtk/plugins.py", line 216, in on_plugin_toggle
    self.pengine.activate_plugins([plugin])
  File "/app/lib/python3.9/site-packages/GTG/core/plugins/engine.py", line 202, in activate_plugins
    plugin.instance.activate(api)
  File "/app/lib/python3.9/site-packages/GTG/plugins/hamster/hamster.py", line 155, in activate
    self.hamster = dbus.SessionBus().get_object('org.gnome.Hamster',
  File "/app/lib/python3.9/site-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/app/lib/python3.9/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/app/lib/python3.9/site-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/app/lib/python3.9/site-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/app/lib/python3.9/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown

Software versions:

  • Getting Things GNOME! v0.6
  • CPython 3.9.9 (main, Nov 10 2011, 15:00:00) [GCC 11.2.0]
  • GTK 3.24.34, GLib 2.70.5
  • PyGLib 3.42.1, PyGObject 3.42.1
  • Linux-5.15.0-35-generic-x86_64-with-glibc2.33`

@AymericDeschard
Copy link

AymericDeschard commented Jun 29, 2022

Issue raised by @idle5 solved by managing access rights in flatseal #770 (comment)

But, the error message should be more comprehensive and the soft should not crash.

If it crashes when one wants to register time within GTG, it's because the Hamster server is not running, launch Hamster at least once.

@nekohayo nekohayo changed the title Activating the Hamster plugin without Hamster present will cause tracebacks, and will prevent GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Activating the Hamster plugin without Hamster present will cause tracebacks, and will prevent GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Jul 10, 2022
@nekohayo nekohayo changed the title Activating the Hamster plugin without Hamster present will cause tracebacks, and will prevent GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Activating the Hamster plugin without Hamster present (or missing permissions in Flatpak) will cause tracebacks, and will prevent GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Feb 26, 2024
@nekohayo nekohayo added the packaging Flatpak packages (anything else = NOPE.png) label Feb 26, 2024
@nekohayo nekohayo changed the title Activating the Hamster plugin without Hamster present (or missing permissions in Flatpak) will cause tracebacks, and will prevent GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Activating the Hamster plugin without Hamster present (or missing permissions in Flatpak) will cause tracebacks on startup, crashing / preventing GTG's future launches with DBus.Error.NameHasNoOwner and DBus.Error.ServiceUnknown Feb 26, 2024
@nekohayo
Copy link
Member

Oh, it turns out that a gazillion mysterious report tickets (#962, #963, #983, #990 …) were all duplicates of this issue here!

@flavin would you be willing to try to come up with a fix for this, based on the latest git master version in light of the recently merged megaport?


Note: this crash is not the same as #961 / #980.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug packaging Flatpak packages (anything else = NOPE.png) plugins Plugins and extra backends priority:critical reproducible-in-git Issues that affect the current dev version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants