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

The Hamster application crashes upon start-up #289433

Closed
CoderThomasB opened this issue Feb 17, 2024 · 6 comments
Closed

The Hamster application crashes upon start-up #289433

CoderThomasB opened this issue Feb 17, 2024 · 6 comments
Labels
0.kind: bug Something is broken

Comments

@CoderThomasB
Copy link

Describe the bug

When installed and run, the 'hamster' application crashes with an error about gettext and bind_textdomain_codeset.

Steps To Reproduce

Steps to reproduce the behaviour:

  1. nix-shell -p hamster --run hamster

Expected behaviour

The application does not crash and display it's normal GUI

Screenshots

Traceback (most recent call last):
  File "/nix/store/wdb3brr9fsf84mf4ansihsccnni4q046-hamster-3.0.2/bin/.hamster-wrapped", line 416, in <module>
    i18n.setup_i18n()
  File "/nix/store/wdb3brr9fsf84mf4ansihsccnni4q046-hamster-3.0.2/lib/python3.11/site-packages/hamster/lib/i18n.py", line 24, in setup_i18n
    module.bind_textdomain_codeset('hamster','utf8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'

Additional context

None

Notify maintainers

@fabianhauser

Metadata

[thomas@thomas-desktop:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.75, NixOS, 23.11 (Tapir), 23.11.3684.f4a8d6d5324c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a 👍 reaction to issues you find important.

@CoderThomasB CoderThomasB added the 0.kind: bug Something is broken label Feb 17, 2024
@ghpzin
Copy link
Contributor

ghpzin commented Feb 18, 2024

Related upstream issue:
projecthamster/hamster#726
PR with fix:
projecthamster/hamster#715
Should be in version 3.0.3

3.0.3 is in nixos-unstable now:
#282942
Maybe it should be backported to 23.11

@fabianhauser
Copy link
Member

@CoderThomasB can you confirm the backport PR solves the problem for you? You can test with nix-review pr 290152.

@CoderThomasB
Copy link
Author

Sorry for the late reply, but trying to use hamster inside a nix shell with nix-review pr 290152 gives this error:

Traceback (most recent call last):
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/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: Could not get owner of name 'org.gnome.Hamster': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/bin/.hamster-wrapped", line 150, in on_activate_window
    self._open_window(action.get_name(), data)
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/bin/.hamster-wrapped", line 185, in _open_window
    self.overview_controller = Overview()
                               ^^^^^^^^^^
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 477, in __init__
    self.find_facts()
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 531, in find_facts
    self.facts = self.storage.get_facts(start, end, search_terms=search)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 156, in get_facts
    for fact in self.conn.GetFactsJSON(dbus_range, search_terms)]
                ^^^^^^^^^
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 96, in conn
    self._connection = dbus.Interface(self.bus.get_object('org.gnome.Hamster',
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/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: The name org.gnome.Hamster was not provided by any .service files
Traceback (most recent call last):
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/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: Could not get owner of name 'org.gnome.Hamster': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/bin/.hamster-wrapped", line 150, in on_activate_window
    self._open_window(action.get_name(), data)
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/bin/.hamster-wrapped", line 185, in _open_window
    self.overview_controller = Overview()
                               ^^^^^^^^^^
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 477, in __init__
    self.find_facts()
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 531, in find_facts
    self.facts = self.storage.get_facts(start, end, search_terms=search)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 156, in get_facts
    for fact in self.conn.GetFactsJSON(dbus_range, search_terms)]
                ^^^^^^^^^
  File "/nix/store/qvc4djvh3pnq27la4r8z52rajr4xgfw3-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 96, in conn
    self._connection = dbus.Interface(self.bus.get_object('org.gnome.Hamster',
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/1z77fl776zskpcjm8w5d0g3hj4cdzdg8-python3.11-dbus-python-1.2.18/lib/python3.11/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: The name org.gnome.Hamster was not provided by any .service files

@CoderThomasB
Copy link
Author

I have updated my nix channel and rebuilt, the original error is gone, but the same error I got by using nix-review pr 290152 is still occurring.

[thomas@thomas-desktop:~]$ hamster
'hamster' from package 'hamster' will be run, confirm? [yn]: y
this path will be fetched (0.43 MiB download, 3.11 MiB unpacked):
  /nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3
copying path '/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3' from 'https://cache.nixos.org'...
Traceback (most recent call last):
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/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: Could not get owner of name 'org.gnome.Hamster': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/bin/.hamster-wrapped", line 150, in on_activate_window
    self._open_window(action.get_name(), data)
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/bin/.hamster-wrapped", line 185, in _open_window
    self.overview_controller = Overview()
                               ^^^^^^^^^^
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 477, in __init__
    self.find_facts()
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 531, in find_facts
    self.facts = self.storage.get_facts(start, end, search_terms=search)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 156, in get_facts
    for fact in self.conn.GetFactsJSON(dbus_range, search_terms)]
                ^^^^^^^^^
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 96, in conn
    self._connection = dbus.Interface(self.bus.get_object('org.gnome.Hamster',
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/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: The name org.gnome.Hamster was not provided by any .service files
Traceback (most recent call last):
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/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: Could not get owner of name 'org.gnome.Hamster': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/bin/.hamster-wrapped", line 150, in on_activate_window
    self._open_window(action.get_name(), data)
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/bin/.hamster-wrapped", line 185, in _open_window
    self.overview_controller = Overview()
                               ^^^^^^^^^^
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 477, in __init__
    self.find_facts()
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/overview.py", line 531, in find_facts
    self.facts = self.storage.get_facts(start, end, search_terms=search)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 156, in get_facts
    for fact in self.conn.GetFactsJSON(dbus_range, search_terms)]
                ^^^^^^^^^
  File "/nix/store/zqsdns2i957i1l6zxbvldkzpiz5axhb4-hamster-3.0.3/lib/python3.11/site-packages/hamster/client.py", line 96, in conn
    self._connection = dbus.Interface(self.bus.get_object('org.gnome.Hamster',
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ll9563yf57hvx8p7xrhvqpb4b3syviq6-python3.11-dbus-python-1.2.18/lib/python3.11/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: The name org.gnome.Hamster was not provided by any .service files

@ghpzin
Copy link
Contributor

ghpzin commented Mar 17, 2024

Considering you are on NixOS try with module option instead:
programs.hamster.enable = true;
From your error it seems to be related to dbus permissions and module has it:

services.dbus.packages = [ pkgs.hamster ];

@CoderThomasB
Copy link
Author

Thanks, @ghpzin, that fixed my issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants