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

Keyring AttributeError #483

Closed
KingET opened this issue Dec 28, 2020 · 6 comments
Closed

Keyring AttributeError #483

KingET opened this issue Dec 28, 2020 · 6 comments

Comments

@KingET
Copy link

KingET commented Dec 28, 2020

Describe the bug
I have just installed a fresh install of Linux Distro and for some reason I am unable to load up a Protonvpn-cli. I get this AttributeError in the end.

AttributeError: module 'keyring.backends' has no attribute 'kwallet'

To Reproduce
Steps to reproduce the behavior:

  1. Install ProtonVpn
  2. Open Konsole
  3. Type "protonvpn-cli"
  4. See error
Traceback (most recent call last):
  File "/usr/bin/protonvpn-cli", line 11, in <module>
    load_entry_point('protonvpn-cli==3.1.0', 'console_scripts', 'protonvpn-cli')()
  File "/usr/lib/python3/dist-packages/protonvpn_cli/main.py", line 20, in main
    from .cli import ProtonVPNCLI
  File "/usr/lib/python3/dist-packages/protonvpn_cli/cli.py", line 9, in <module>
    from .cli_wrapper import CLIWrapper
  File "/usr/lib/python3/dist-packages/protonvpn_cli/cli_wrapper.py", line 32, in <module>
    from protonvpn_nm_lib.services.user_manager import UserManager
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/services/user_manager.py", line 10, in <module>
    from .user_session_manager import UserSessionManager
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/services/user_session_manager.py", line 14, in <module>
    class UserSessionManager:
  File "/usr/lib/python3/dist-packages/protonvpn_nm_lib/services/user_session_manager.py", line 16, in UserSessionManager
    keyring.backends.kwallet.DBusKeyring,
AttributeError: module 'keyring.backends' has no attribute 'kwallet'

Expected behavior
Im not sure?

Environment

  • OS: [e.g. Kali Linux]
    Kali Linux

$ pip list | grep keyring
keyring 21.7.0

$ keyring --list-backends
keyring.backends.kwallet.DBusKeyring (priority: 5.1)
keyring.backends.chainer.ChainerBackend (priority: 10)
keyring.backends.SecretService.Keyring (priority: 5)
keyring.backends.fail.Keyring (priority: 0)

Additional context
I greatly appropriate the help thank you.

@H3nd02019
Copy link

I just had this issue. Revert to 21.5.0 by running sudo pip3 install keyring==21.5.0 or sudo pip install keyring==21.5.0
I haven't tested on 21.7.0, but I do know that reverting to 21.5.0 fixes this issue with protonvpn-cli
Enjoy... :)

@BippyMiester
Copy link

I just had this issue. Revert to 21.5.0 by running sudo pip3 install keyring==21.5.0 or sudo pip install keyring==21.5.0
I haven't tested on 21.7.0, but I do know that reverting to 21.5.0 fixes this issue with protonvpn-cli
Enjoy... :)

Can confirm by running sudo pip3 install keyring==21.5.0 did fix the issue. Thanks again!

@H3nd02019
Copy link

No probz. I've also spoken to proton staff. They are currently working on addressing the issue, so keep an eye out and test newer keyring after the next proton vpn update.

@foxsky22
Copy link

foxsky22 commented Jan 5, 2021

I just had this issue. Revert to 21.5.0 by running sudo pip3 install keyring==21.5.0 or sudo pip install keyring==21.5.0
I haven't tested on 21.7.0, but I do know that reverting to 21.5.0 fixes this issue with protonvpn-cli
Enjoy... :)

Thank you.. This helped.
for fresh installed. do apt install python3-pip before running sudo pip3 install keyring==21.5.0 or sudo pip install keyring==21.5.0

@jaraco
Copy link
Owner

jaraco commented Jan 24, 2021

Looking at the changelog, since #403, Keyring 21.6 no longer eagerly initializes the backends and describes what consumers like protonvpn need to do to restore the prior behavior (explicitly invoke init_backend()).

I don't think I considered this failure mode when making the change, where a consumer is not reliant on the initialization of a backend, but is reliant on the backend discovery (initialized plugins). It may be possible and even desirable for keyring to expose the (currently protected) keyring.backend._load_plugins() to allow consumers to ensure that plugins are loaded even while no keyring is yet initialized.

However, in this case, I can't see the usage, but I do see keyring.backends.kwallet.DBusKeyring, in the traceback, indicating that the tool is explicitly referencing the DBusKeyring class, which is not recommended. I would instead recommend using keyring.core.load_keyring('keyring.backends.kwallet.DBusKeyring') in this case.

Hope that helps.

Since this issue seems to be rooted in proprietary code and there's no action strongly implicated for keyring, I'm going to close this issue, but feel free to comment or open a new issue if there's more that keyring could/should be doing to support the protonvpn case.

@jaraco jaraco closed this as completed Jan 24, 2021
@Redsandro
Copy link

It may be possible and even desirable for keyring to expose the (currently protected) keyring.backend._load_plugins() to allow consumers to ensure that plugins are loaded even while no keyring is yet initialized.

Oh my gawd, thank you for mentioning this. After hours of googling and struggling to figure out why I couldn't for the life of me get my scripts to work in python3.

AttributeError: module 'keyring.backends' has no attribute 'SecretService'

I randomly stumble upon this and finally learn I need to do a keyring.backend._load_plugins() now. I would have sure had an extra 2 years to live if I had figured this out sooner, for example if the error message was something like this:

AttributeError: module 'keyring.backends' has no attribute 'SecretService'
Did you forget to keyring.backend._load_plugins()?

Anyway, this is unrelated to protonvpn and I thought I'd quote the above error message so lucky people can find this suggestion a little earlier. 🙂

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

6 participants