Package gir1.2-secret-1 changes behaviour
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- linux, python
- Domain
- authentication, backend
Research direction
Start by reproducing the behavior with the Dockerfile and command in the issue, then inspect the keyring.backends.chainer and keyring.backends.libsecret paths shown in the traceback. Done means installing gir1.2-secret-1 without a secrets service produces the same usable fallback behavior as when it is absent, allowing devpi login to request a password.
Written by the indexing model from the issue text.
Description
Describe the bug
I ran into an error which prevented me from using devpi, cause by the presence of gir1.2-secret-1 package. devpi ended up in error
$ devpi login vzima
Traceback (most recent call last):
File "/home/vzima/.local/bin/devpi", line 8, in <module>
sys.exit(main())
File "/home/vzima/.local/lib/python3.9/site-packages/devpi/main.py", line 36, in main
return method(hub, hub.args)
File "/home/vzima/.local/lib/python3.9/site-packages/devpi/login.py", line 13, in main
password = hub.hook.devpiclient_get_password(
File "/home/vzima/.local/lib/python3.9/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/home/vzima/.local/lib/python3.9/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/home/vzima/.local/lib/python3.9/site-packages/pluggy/manager.py", line 84, in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
File "/home/vzima/.local/lib/python3.9/site-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/home/vzima/.local/lib/python3.9/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/vzima/.local/lib/python3.9/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/usr/lib/python3/dist-packages/keyring/devpi_client.py", line 11, in devpiclient_get_password
return keyring.get_password(url, username)
File "/usr/lib/python3/dist-packages/keyring/core.py", line 55, in get_password
return get_keyring().get_password(service_name, username)
File "/usr/lib/python3/dist-packages/keyring/backends/chainer.py", line 51, in get_password
password = keyring.get_password(service, username)
File "/usr/lib/python3/dist-packages/keyring/backends/libsecret.py", line 62, in get_password
items = Secret.password_search_sync(
gi.repository.GLib.GError: g-dbus-error-quark: The name org.freedesktop.secrets was not provided by any .service files (2)
although the gnome-keyring is not installed and there is no backend for the keyring available (that I'm aware of). Anyway the uninstallation of gir1.2-secret-1 resolved the problem. The issue may be related to #19.
To Reproduce
I wan able to reproduce the issue using docker:
Dockerfile
FROM debian:testing-slim
# Install build dependencies from debian
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
gir1.2-secret-1 \
python3-gi \
python3-keyring \
python3-pip \
&& rm -rf /var/lib/apt/lists/* \
# And a devpi client
&& /usr/bin/pip install devpi-client
WORKDIR /app
docker build -t devpi-test .
docker run --privileged -ti --rm devpi-test:latest /bin/bash -c "dbus-run-session -- python3 -c 'from keyring.devpi_client import devpiclient_get_password; devpiclient_get_password(\"http://example.org/\", \"username\")'"
This produces the error same as above
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/keyring/devpi_client.py", line 11, in devpiclient_get_password
return keyring.get_password(url, username)
File "/usr/lib/python3/dist-packages/keyring/core.py", line 55, in get_password
return get_keyring().get_password(service_name, username)
File "/usr/lib/python3/dist-packages/keyring/backends/libsecret.py", line 62, in get_password
items = Secret.password_search_sync(
gi.repository.GLib.GError: g-dbus-error-quark: The name org.freedesktop.secrets was not provided by any .service files (2)
but a different output if gir1.2-secret-1 is not installed:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/keyring/devpi_client.py", line 11, in devpiclient_get_password
return keyring.get_password(url, username)
File "/usr/lib/python3/dist-packages/keyring/core.py", line 55, in get_password
return get_keyring().get_password(service_name, username)
File "/usr/lib/python3/dist-packages/keyring/backends/fail.py", line 25, in get_password
raise NoKeyringError(msg)
keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
Expected behavior
Same behavior for cases when gir1.2-secret-1 is installed and when it isn't. In case of devpi login, it should result in devpi asking for password directly.
Environment
- OS: Linux Debian testing
$ pip list | grep keyring
## Desktop
keyring 23.3.0
keyrings.alt 4.1.0
## Docker
keyring 23.5.0
...
$ keyring --list-backends
## Desktop
keyring.backends.chainer.ChainerBackend (priority: 10)
keyrings.alt.file.EncryptedKeyring (priority: 0.6)
keyring.backends.fail.Keyring (priority: 0)
keyrings.alt.file.PlaintextKeyring (priority: 0.5)
## Docker
keyring.backends.chainer.ChainerBackend (priority: -1)
keyring.backends.fail.Keyring (priority: 0)
keyring.backends.libsecret.Keyring (priority: 4.8)
...
Additional context
Add any other context about the problem here.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 208
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jaraco/keyring
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
macOS: denied keychain prompt on delete raises PasswordDeleteError instead of KeyringLockedPossibly taken @r3wretrhy claimed this 46 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 3/5 1-2 days Newbie friendliness 50/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Remove B018 suppressions after adopting skeleton's B018 ignorePossibly taken @Madin-H23 claimed this 26 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 78/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
benchflow-ai/skillsbench#1090 ·
-
Missing unit tests for human-readable date/time formatters in utils/datetime.pyPossibly taken @prabhleen2317 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/iceberg-python#4387 ·
Maintainers usually reply within 1 day
-
[BUG] Hermes MCP adapter drops cwd, extra passthrough keys and the SSE transport when writing config.yamlPossibly taken @Parth-Vasave claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/apm#3749 · 1 comment ·
Maintainers usually reply within 1 day
-
backend bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA/numba-cuda-mlir#467 · 1 comment ·
Maintainers usually reply within 3 days