Jrnl: "Can't store password on keychain" on Sierra

Created on 26 Mar 2017  路  16Comments  路  Source: jrnl-org/jrnl

On my El Capitan laptop everything works as expected, but on my laptop with Sierra jrnl gives the following error message when choosing to store the password in the keychain after creating an encrypted journal:

Traceback (most recent call last):
File "/usr/local/bin/jrnl", line 11, in
load_entry_point('jrnl==1.9.8', 'console_scripts', 'jrnl')()
File "/usr/local/Cellar/jrnl/1.9.8/libexec/lib/python2.7/site-packages/jrnl/cli.py", line 138, in run
config = install.install_jrnl(CONFIG_PATH)
File "/usr/local/Cellar/jrnl/1.9.8/libexec/lib/python2.7/site-packages/jrnl/install.py", line 76, in install_jrnl
util.set_keychain("default", password)
File "/usr/local/Cellar/jrnl/1.9.8/libexec/lib/python2.7/site-packages/jrnl/util.py", line 65, in set_keychain
keyring.set_password('jrnl', journal_name, password)
File "/usr/local/Cellar/jrnl/1.9.8/libexec/lib/python2.7/site-packages/keyring/core.py", line 48, in set_password
_keyring_backend.set_password(service_name, username, password)
File "/usr/local/Cellar/jrnl/1.9.8/libexec/lib/python2.7/site-packages/keyring/backends/OS_X.py", line 37, in set_password
raise PasswordSetError("Can't store password on keychain")
keyring.errors.PasswordSetError: Can't store password on keychain

bug mac needs more info stale

Most helpful comment

I also installed via Homebrew. Trying the dbus before and after reinstalling jrnl again through Homebrew didn't help. Restarting, locking and unlocking Keychain Access didn't help. However, installing jrnl through pip2 then installing PyCrypt as instructed also through pip fixed everything (can even decrypt old journal files).

All 16 comments

I got this error too.

I've ran into that too. There is an issue that's been opened for this problem earlier:
https://github.com/maebert/jrnl/issues/445

It seems to be problematic when installed via Homebrew. Use pip directly, it fixed it for me and seems to be a good workaround.

From the issue I've referenced it seemed that the reason this breaks is because Homebrew kept 1.9.7 while pip installed 1.9.8. Your stack traces shows that Homebrew installed 1.9.8 which makes me thing that the actual problem lies in Homebrew. @maebert any clues why that may be?

I also just ran into this.

So did I
$ pip install pycrypto
"Requirement already satisfied: pycrypto in /usr/local/lib/python2.7/site-packages"

If you've installed jrnl with homebrew, try:

brew install dbus
brew services start dbus

Otherwise / additionally, try

pip install -U keyring

Does that help?

I installed jrnl using homebrew. I tried installing all of those (dbus and keyring) and it still does not work for me.

FWIW, I'm also getting this issue, even though I have no issues setting or getting passwords with keyring in the python 2 or 3 REPL.

Since this works with pip, I guess this is a Homebrew issue?

I also installed via Homebrew. Trying the dbus before and after reinstalling jrnl again through Homebrew didn't help. Restarting, locking and unlocking Keychain Access didn't help. However, installing jrnl through pip2 then installing PyCrypt as instructed also through pip fixed everything (can even decrypt old journal files).

@hyiltiz You my good sir are a hero! First installing jrnl via homebrew and then reinstalling with pip install jrnl[encrypted] solves the issue for me.

Only tested on one Sierra installation now. Will try it on another computer with High Sierra later today.

I ran into this error on MacOS Mojave (10.14.0). This was after I installed Microsoft vsts-cli using homebrew.

Following the ideas in https://github.com/jaraco/keyring/issues/219 , I re-codesigned the Python binary, and that solved it:

codesign -f -s - /usr/local/Cellar/vsts-cli/0.1.4/libexec/bin/python3.7

This is only useful if you have an Apple developer account to do codesigning, of course. But better than nothing.

Does this issues still happen with v2.0?

What actually helped me was to go to keychain. Lock the Login keychain and then unlock it again

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

makais picture makais  路  5Comments

wren picture wren  路  3Comments

arisAlexis picture arisAlexis  路  4Comments

mandarvaze picture mandarvaze  路  6Comments

micahellison picture micahellison  路  5Comments