-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Error: Unable to store the password for poetry-repository-pypi in the key ring: Failed to unlock the collection! #2692
Comments
Can you try unlocking the collection using something like Seahorse? Usually this happens when your keyring was left locked after login etc. Manual unlocks and/or reboots are known fix this issue. Note that this has nothing to do with |
Why does poetry need the keyring? Is it possible to build/deploy in CI/CD without using a keyring? |
@earonesty poetry/.github/workflows/release.yml Lines 261 to 266 in 17b165b
|
@python-poetry/triage we should consider providing a error solution exception via crashtest or implement an option to skip keyring on failure when writing l; and warn in both write and read cases where this fails. |
I have this problem with keyring working with Seahorse or something if I'm logged into a remote machine over ssh. If I log in with X2Go instead of getting an error it just freezes... 🤷🏼♂️ Will return with more info if I get any. EDIT 1: I get this error "Failed to unlock the collection!" if I try to use keyring in the following manner while logged into a remote machine (Linux Mint 20 XFCE, Seahorse is the password manager): import keyring
keyring.set_password("poetry-repository-testpypi", "__token__", "<my-testpypi-key>" So I guess keyring doesn't work over SSH? I'll look into the issues over at jaraco/keyring. EDIT 2: The README at jaraco/keyring provides instructions for running keyring on a headless system. This seems like quite a bit of hassle and very non-obvious for poetry users. |
this fixed it for me... https://blog.frank-mich.com/python-poetry-1-0-0-private-repo-issue-fix/ |
right, but why bother storing credentials? i don't want it to.
|
well, maybe a permission problem, with "sudo" save me in this case |
Poetry strikes again 💣 |
Similar error occured when I was using KeyRingError Unable to retrieve the password for poetry-repository-pypi from the key ring at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/utils/password_manager.py:39 in get_password |
Oh fixed it today by using |
|
This, but is not cool to have to install something of |
Had the same problem in a container, solved it by setting the null keyring within the underlying lib, it's just an env variable:
see https://pypi.org/project/keyring/ disabling keyring |
OK keyringerror again. Then fixed it by |
I'm quite curious about this as well actually. I can't remember ever having to install any package with root permissions. Infact, If I remember correctly, pip specifically warns against it. Also, why exactly does poetry modify the error Traceback? sigh I have other questions, but mainly why does poetry even request access from the keyring in the first place? |
Installing |
this works to evade the keyring, and is appropriate for ci/cd
|
I'm running into a similar error with Poetry v1.2.0 for simple operations like installing a plugin in my Debian development environment. I'm not sure whether this is exactly the same issue as described above or just results in a similar error message.
This seems to have happened because I was SSH'd into my development environment, which has the GNOME Keyring installed. When I RDP'd in so I would have an X session, then the GNOME keyring dialog popped up to unlock the keyring. On the surface, it doesn't seem like there's any need for the keyring in this situation, because I'm installing a public plugin. It seems like maybe there's a code path where Poetry attempts to unlock the keyring even if it's not going to be needed. I don't get this error on Windows or MacOS, although it's possible that a keyring is just silently being unlocked under the covers on those platforms, and I don't notice because it's not failing. My workaround is to explicitly set a null keyring as suggested in @Cardu 's comment above, in Poetry issue #6277, and also in pip issue #6773:
I also confirmed that |
Im also getting this error on my Debian Distro when trying to configure a new project with poetry init. When trying to specify the dependencies it fails with the following errors:
|
Also happens to me when connecting via SSH, and my workaround is to disable My two cents are that this behaviour is not consistent with the docs.
Of course, it may well be an issue on the keyring side (locked, not set up properly...), but would be nice to fall back gracefully. A bit odd, but sometimes poetry depends on
EDIT: the keyring usage is handled in poetry/src/poetry/utils/password_manager.py Lines 109 to 141 in 0686427
|
Closing as duplicate of #1917 |
This, easiest solution and worked perfectly |
I ran into same issue after updating Poetry from 1.1.xxx to 1.2.2 on Mac BigSur. |
I have a Mac, and I needed to delete an old password in the Keychain in order to get it to work. I went to the |
Just to add to the macos solutions above: the Issue for me was that the key is added to the keychain with access only allowed by a specific python version. When I switched python versions then the poetry config command started failing. The solution is to allow all apps on the poetry keys or add the additional python versions you need. Ideally poetry would handle this or at least provide a better error message. |
fwiw, i found this really helpful for getting into my keyring on a remote box (jammy/ubuntu) with note that you have to |
[MacOS] |
On macOs: |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi, I am getting
[KeyRingError] Unable to store the password for poetry-repository-pypi in the key ring: Failed to unlock the collection!
when running:poetry config pypi-token.pypi <MY PYPI TOKEN>
Searched for this error everywhere but couldn't find anything. Running on the last version of Poetry and Ubuntu 18.04 LTS.
Also, if I set the token using an environment variable I get:
Unable to retrieve the password for poetry-repository-pypi from the key ring
.The text was updated successfully, but these errors were encountered: