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

Crash with gi.repository.GLib.GError: g-dbus-error-quark: The name org.freedesktop.secrets was not provided by any .service files #600

Closed
Diaoul opened this issue Sep 26, 2022 · 1 comment · Fixed by #603

Comments

@Diaoul
Copy link

Diaoul commented Sep 26, 2022

Describe the bug
It crashes

To Reproduce
Steps to reproduce the behavior:

  1. Run keyring set system test
  2. Observe the exception
Password for 'test' in 'system': 
Traceback (most recent call last):
  File "/usr/bin/keyring", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 132, in main
    return cli.run(argv)
  File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 68, in run
    return method()
  File "/usr/lib/python3.10/site-packages/keyring/cli.py", line 85, in do_set
    set_password(self.service, self.username, password)
  File "/usr/lib/python3.10/site-packages/keyring/core.py", line 60, in set_password
    get_keyring().set_password(service_name, username, password)
  File "/usr/lib/python3.10/site-packages/keyring/backends/libsecret.py", line 85, in set_password
    stored = Secret.password_store_sync(
gi.repository.GLib.GError: g-dbus-error-quark: The name org.freedesktop.secrets was not provided by any .service files (2)

Expected behavior
Not an error

Environment

  • Arch Linux with python-keyring 23.9.3-1
$ pip list | grep keyring
keyring              23.9.3

$ keyring --list-backends
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.libsecret.Keyring (priority: 4.8)
keyring.backends.chainer.ChainerBackend (priority: -1)

Additional context
At this is now a dependency of poetry, I cannot run poetry anymore. I can workaround this using:

export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
lazka added a commit to lazka/keyring that referenced this issue Oct 31, 2022
In case libsecret and its Python bindings are available the
libsecret backend will get selected. This doesn't mean though
that the system service it connects to is available.

This leads to the backend being used and then failing, for example
in get_credential() with:
g-dbus-error-quark: The name org.freedesktop.secrets is unknown (2)

To avoid this ask libsecret to connect to the system service first
before considering to use it.

Fixes jaraco#600
@lazka
Copy link
Contributor

lazka commented Oct 31, 2022

I've created #603 for this

jaraco pushed a commit to lazka/keyring that referenced this issue Nov 4, 2022
In case libsecret and its Python bindings are available the
libsecret backend will get selected. This doesn't mean though
that the system service it connects to is available.

This leads to the backend being used and then failing, for example
in get_credential() with:
g-dbus-error-quark: The name org.freedesktop.secrets is unknown (2)

To avoid this ask libsecret to connect to the system service first
before considering to use it.

Fixes jaraco#600
jaraco pushed a commit to lazka/keyring that referenced this issue Nov 4, 2022
In case libsecret and its Python bindings are available the
libsecret backend will get selected. This doesn't mean though
that the system service it connects to is available.

This leads to the backend being used and then failing, for example
in get_credential() with:
g-dbus-error-quark: The name org.freedesktop.secrets is unknown (2)

To avoid this ask libsecret to connect to the system service first
before considering to use it.

Fixes jaraco#600
lazka added a commit to lazka/keyring that referenced this issue Nov 4, 2022
In case libsecret and its Python bindings are available the
libsecret backend will get selected. This doesn't mean though
that the system service it connects to is available.

This leads to the backend being used and then failing, for example
in get_credential() with:
g-dbus-error-quark: The name org.freedesktop.secrets is unknown (2)

To avoid this ask libsecret to connect to the system service first
before considering to use it.

Fixes jaraco#600
lazka added a commit to lazka/keyring that referenced this issue Nov 4, 2022
In case libsecret and its Python bindings are available the
libsecret backend will get selected. This doesn't mean though
that the system service it connects to is available.

This leads to the backend being used and then failing, for example
in get_credential() with:
g-dbus-error-quark: The name org.freedesktop.secrets is unknown (2)

To avoid this ask libsecret to connect to the system service first
before considering to use it.

Fixes jaraco#600
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 a pull request may close this issue.

2 participants