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

Fails to login when Kwallet is default keyring #5137

Open
eeickmeyer opened this issue Oct 31, 2024 · 7 comments
Open

Fails to login when Kwallet is default keyring #5137

eeickmeyer opened this issue Oct 31, 2024 · 7 comments

Comments

@eeickmeyer
Copy link

Bug Description

When Kwallet is default keyring, snapcraft throws an error that python-dbus is not installed. I assume, therefore, that python-dbus is not included in the snap and therefore it is unable to communicate with dbus in the system.

To Reproduce

Install snapcraft snap install snapcraft on Kubuntu or Ubuntu Studio
Attempt snapcraft login or any other item where snapcraft requires access to the system keyring
Most of the time* it will fail with:

snapcraft internal error: RuntimeError('python-dbus not installed')    

*I say most of the time because this is inconsistent between installations, but this happened on a clean install I did to alleviate any error on my part. I have a separate upgraded install where it worked, but this is reproducible 100% of the time on the clean install.

Environment

Running on Ubuntu Studio 24.10, but this has happened under 24.04 LTS as well.

snapcraft.yaml

No relevant snapcraft.yaml as this happens when merely accessing the keyring via `snapcraft login` or `snapcraft upload` or the like.

Relevant log output

2024-10-31 09:26:56.195 Starting snapcraft, version 8.4.4
2024-10-31 09:26:56.195 Log verbosity level set to BRIEF
2024-10-31 09:26:56.195 Preparing application...
2024-10-31 09:26:56.195 Configuring application...
2024-10-31 09:26:56.196 Setting up ConfigService
2024-10-31 09:26:56.229 Build plan: platform=None, build_for=None
2024-10-31 09:26:56.229 Running snapcraft login on host
2024-10-31 09:26:56.230 snapcraft internal error: RuntimeError('python-dbus not installed')
2024-10-31 09:26:56.232 Traceback (most recent call last):
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/craft_application/application.py", line 568, in run
2024-10-31 09:26:56.232     return_code = self._run_inner()
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/snapcraft/application.py", line 215, in _run_inner
2024-10-31 09:26:56.232     return_code = super()._run_inner()
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/craft_application/application.py", line 549, in _run_inner
2024-10-31 09:26:56.232     return_code = dispatcher.run() or os.EX_OK
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/craft_cli/dispatcher.py", line 487, in run
2024-10-31 09:26:56.232     return self._loaded_command.run(self._parsed_command_args)
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/snapcraft/commands/account.py", line 114, in run
2024-10-31 09:26:56.232     store.StoreClientCLI().login()
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/snapcraft/store/client.py", line 179, in __init__
2024-10-31 09:26:56.232     self.store_client = get_client(ephemeral=ephemeral)
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/snapcraft/store/client.py", line 161, in get_client
2024-10-31 09:26:56.232     client = craft_store.UbuntuOneStoreClient(
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/craft_store/ubuntu_one_store_client.py", line 46, in __init__
2024-10-31 09:26:56.232     super().__init__(
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/craft_store/base_client.py", line 78, in __init__
2024-10-31 09:26:56.232     self._auth = Auth(
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/craft_store/auth.py", line 189, in __init__
2024-10-31 09:26:56.232     self._keyring = keyring.get_keyring()
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/keyring/core.py", line 33, in get_keyring
2024-10-31 09:26:56.232     init_backend()
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/keyring/core.py", line 84, in init_backend
2024-10-31 09:26:56.232     set_keyring(_detect_backend(limit))
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/keyring/core.py", line 99, in _detect_backend
2024-10-31 09:26:56.232     or load_config()
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/keyring/core.py", line 184, in load_config
2024-10-31 09:26:56.232     return load_keyring(keyring_name)
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/keyring/core.py", line 137, in load_keyring
2024-10-31 09:26:56.232     class_.priority
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/jaraco/classes/properties.py", line 202, in __get__
2024-10-31 09:26:56.232     return self.fget.__get__(None, owner)()
2024-10-31 09:26:56.232   File "/snap/snapcraft/12961/lib/python3.10/site-packages/keyring/backends/kwallet.py", line 43, in priority
2024-10-31 09:26:56.232     raise RuntimeError('python-dbus not installed')
2024-10-31 09:26:56.232 RuntimeError: python-dbus not installed
2024-10-31 09:26:56.232 Full execution log: '/home/erich/.local/state/snapcraft/log/snapcraft-20241031-092656.194389.log'

Additional context

I believe this can be alleviated by simply including python-dbus in the snapcraft snap, but this is theory.

@lengau
Copy link
Contributor

lengau commented Oct 31, 2024

Thanks for the report! I'm not facing this on Kubuntu 24.10 with the same revision of snapcraft you have. I don't have gnome-keyring installed either. Could you list the packages you have?

I do think that python-dbus would probably fix this for you, but I'd like to find the underlying difference between our machines that's causing this.

@eeickmeyer
Copy link
Author

Could you list the packages you have?

Alex, my friend, that was an excellent way to literally crash a Github page because, well, I tried to paste that in a code box. 🤣

Instead, here's a text doc attachment that is sure not to crash it. We're talking Ubuntu Studio here. We ship... packages. 😆

installed.txt

@lengau
Copy link
Contributor

lengau commented Oct 31, 2024

That was my secret plan all along! 😜

My first guess in the difference is the plasma-secrets package - not sure whether I installed it manually or not, but I have it installed. If that's what it is maybe we should ask the Kubuntu team to include it in the next release in addition to adding python-dbus to the snap. @mr-cal any reason you can think of not to include python-dbus?

@eeickmeyer
Copy link
Author

My first guess in the difference is the plasma-secrets package - not sure whether I installed it manually or not, but I have it installed.

Not sure how you have that installed because apt search plasma-secrets returns null and apt install plasma-secrets gives me

$ sudo apt install plasma-secrets
Error: Unable to locate package plasma-secrets

There's some strange magic you have going on there Mr. Lowe. :suspect: 😁

@mr-cal
Copy link
Collaborator

mr-cal commented Nov 5, 2024

@mr-cal any reason you can think of not to include python-dbus?

@lengau, I agree that we should include python3-dbus as a stage package.

I also can't find that plasma-secrets package.

@lengau
Copy link
Contributor

lengau commented Nov 5, 2024

I'll search for the provenance of plasma-secrets when I get back to my laptop 😳

@dariuszd21
Copy link
Contributor

dariuszd21 commented Nov 6, 2024

I don't have plasma-secrets on my Kubuntu installation and it still works for me 😄

python3-dbus is installed in a fresh minimal version of Kubuntu 24.04 LTS and it's requested by quite a few packages

d@kubuntu-fresh:~$ apt-cache rdepends --installed python3-dbus
python3-dbus
Reverse Depends:
  netplan.io
  python3-distupgrade
  netplan.io
  kubuntu-notification-helper
  hplip
  update-notifier-common
  unattended-upgrades
  system-config-printer-udev
  system-config-printer-common
  software-properties-common
  python3-distupgrade
  python3-cupshelpers
  networkd-dispatcher
  netplan.io
  language-selector-common

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

No branches or pull requests

4 participants