[BUG] keyring.errors.KeyringError: Can't get password from keychain: (-25308, 'Unknown Error')
See original GitHub issueSeveral days before, my PC can plot normally.
But when I try it again yesterday, run chia init
or chia plots create ...
, it always shows this error:
(venv) truxs-iMac-Pro:chia-blockchain haoye.tian$ chia init Traceback (most recent call last): File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/keyring/backends/macOS/init.py”, line 49, in get_password return api.find_generic_password(self.keychain, service, username) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/keyring/backends/macOS/api.py”, line 101, in find_generic_password Error.raise_for_status(status) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/keyring/backends/macOS/api.py”, line 48, in raise_for_status raise cls(status, “Unknown Error”) keyring.backends.macOS.api.Error: (-25308, ‘Unknown Error’)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/bin/chia”, line 33, in <module> sys.exit(load_entry_point(‘chia-blockchain’, ‘console_scripts’, ‘chia’)()) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/chia/cmds/chia.py”, line 77, in main cli() # pylint: disable=no-value-for-parameter File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/click/core.py”, line 829, in call return self.main(*args, **kwargs) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/click/core.py”, line 782, in main rv = self.invoke(ctx) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/click/core.py”, line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/click/core.py”, line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/click/core.py”, line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/click/core.py”, line 610, in invoke return callback(*args, **kwargs) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/click/decorators.py”, line 21, in new_func return f(get_current_context(), *args, **kwargs) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/chia/cmds/keys.py”, line 53, in add_cmd add_private_key_seed(mnemonic) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/chia/cmds/keys_funcs.py”, line 50, in add_private_key_seed sk = keychain.add_private_key(mnemonic, passphrase) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/chia/util/keychain.py”, line 180, in add_private_key index = self._get_free_private_key_index() File “/Users/haoye.tian/Downloads/chia/chia-blockchain/chia/util/keychain.py”, line 167, in _get_free_private_key_index pkent = self._get_pk_and_entropy(pk) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/chia/util/keychain.py”, line 142, in _get_pk_and_entropy read_str = keyring.get_password(self._get_service(), user) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/keyring/core.py”, line 55, in get_password return get_keyring().get_password(service_name, username) File “/Users/haoye.tian/Downloads/chia/chia-blockchain/venv/lib/python3.9/site-packages/keyring/backends/macOS/init.py”, line 55, in get_password raise KeyringError("Can’t get password from keychain: " “{}”.format(e)) keyring.errors.KeyringError: Can’t get password from keychain: (-25308, ‘Unknown Error’)
OS: MacOS 11.3.1 CPU: Intel® Xeon® W-2140B CPU @ 3.20GHz
Using the latest version 1.1.6. Although I reinstall the chia, the bug still exists. I have no idea what happened.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top GitHub Comments
Hi @blank-black, You can just type on your terminal
security -i unlock-keychain
Hope it’s works for youThis appears to happen even if you simply don’t want to use the keychain by clicking on “Deny” when the system dialog appears. This makes the command line unusable for operations that do not require the keys to be unlocked, which previously worked fine.
Workaround when building from source:
Edit the following file
venv/lib/python3.7/site-packages/keyring/backends/macOS/__init__.py
and replace the two exception cases inget_password
withpass
.You will need to re-run the install (
sh install.sh
) after making the change.