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

Random RuntimeError without keyring #654

Closed
pspeter opened this issue Sep 17, 2019 · 2 comments · Fixed by #699
Closed

Random RuntimeError without keyring #654

pspeter opened this issue Sep 17, 2019 · 2 comments · Fixed by #699
Labels
bug Something isn't working 🔒 Outdated

Comments

@pspeter
Copy link
Contributor

pspeter commented Sep 17, 2019

I'm using Ubuntu on WSL. Running any jrnl command using an already encrypted journal file without an available keyring backend will sometimes cause the command to randomly fail. It's about 50/50 for me, I have no idea why it is not consistent. If it works, it will just ask for the password, if it doesn't, the following error appears (using --debug):

DEBUG    jrnl.cli     Reading configuration from file /<path>/.jrnl_config
DEBUG    jrnl.util    Configuration file /<path>/.jrnl_config read correctly
DEBUG    jrnl.cli     Using configuration "{'journals': {'default': {'journal': '<path>/journal.txt', 'encrypt': True}}, 'editor': '/bin/nano', 'encrypt': True, 'default_hour': 9, 'default_minute': 0, 'timeformat': '%d.%m.%Y %H:%M', 'tagsymbols': '@', 'highlight': True, 'linewrap': 79}"
DEBUG    jrnl.cli     Using journal "default"
DEBUG    jrnl.cli     Updating configuration with specific jourlnal overrides {'journal': '<path>/journal.txt', 'encrypt': True}
DEBUG    jrnl.cli     Using journal path <path>/journal.txt
Traceback (most recent call last):
  File "<path>/bin/jrnl", line 11, in <module>
    load_entry_point('jrnl==1.9.8', 'console_scripts', 'jrnl')()
  File "<path>/lib/python3.7/site-packages/jrnl/cli.py", line 194, in run
    journal = Journal.Journal(journal_name, **config)
  File "<path>/lib/python3.7/site-packages/jrnl/Journal.py", line 39, in __init__
    self.open()
  File "<path>/lib/python3.7/site-packages/jrnl/Journal.py", line 105, in open
    journal = util.get_password(keychain=self.name, validator=validate_password)
  File "<path>/lib/python3.7/site-packages/jrnl/util.py", line 37, in get_password
    pwd_from_keychain = keychain and get_keychain(keychain)
  File "<path>/lib/python3.7/site-packages/jrnl/util.py", line 56, in get_keychain
    return keyring.get_password('jrnl', journal_name)
  File "<path>/lib/python3.7/site-packages/keyring/core.py", line 55, in get_password
    return _keyring_backend.get_password(service_name, username)
  File "<path>/lib/python3.7/site-packages/keyring/backends/fail.py", line 24, in get_password
    raise RuntimeError(msg)
RuntimeError: 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.
@pspeter pspeter changed the title Random RuntimeError without keychain Random RuntimeError without keyring Sep 17, 2019
@wren wren added the bug Something isn't working label Oct 5, 2019
@wren
Copy link
Member

wren commented Oct 5, 2019

Yup, we need to look deeper into some keyring related issues. Thanks for filing this!

@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the 🔒 Outdated label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working 🔒 Outdated
Projects
None yet
2 participants