Avoid keyring messages when running command line tools
Asked Answered
E

2

5

I am getting these two messages when running a command line utility (in the case pgcli) in an headless Linux running in Docker:

No handlers could be found for logger "keyring.backend"
Please enter password for encrypted keyring:

How can I configure the logger and the password for keyring, so that I am no longer bothered when running any utility dependent on keyring?

Note that I am on an headless Ubuntu, so I need to know how to do this from the command line.

Thanks

Echolalia answered 23/7, 2018 at 17:2 Comment(0)
A
0

v1.10.2 is now out, with keyring optional. Using pgcli on a headless system should not be a problem anymore.

Ariose answered 24/7, 2018 at 4:44 Comment(8)
I have upgraded to v1.10.2. The "No handlers ..." message is gone, but everytime I run pgcli it keeps asking me "Please enter password for encrypted keyring:". I do not see there any option to disable the use of keyring in the updated pgcli. Please, clarify how can I avoid using keyring. ThanksEcholalia
I have configured the keyring = False under [main] in ~/.config/pgcli/config but still asks me for the encrypted keyring password. I even deleted ~/.local/share/python_keyring/crypted_pass.cfg and then when running pgcli I get the prompt "Please set a password for you new keyring:".Echolalia
Only if I create/edit the file ~/.local/share/python_keyring/keyringrc.cfg with the entry [backend] \n default-keyring=keyrings.alt.file.PlaintextKeyring, then it still uses keyring (and keyring.alt) but the backend does not require a password, so the previous prompt does not appear. HOWEVER, pgcli is still using keyring. Please, check again this situation in pgcli, so that the keyring = False is really working.Echolalia
I'll take a look. Quick question - do you still have keyring package installed? You need to uninstall it (pip uninstall keyring) so that pgcli won't try to use it.Ariose
Yes, I have installed keyring (10.1) and keyrings.alt (1.3).Echolalia
Humm ... But uninstalling keyring is not a solution because other applications may require it. The keyring = False under [main] should be the solution, or an option in the pgcli command-line executable to turn off keyring usage.Echolalia
Yes, I'm looking into why keyring = False does not work. But in the meantime, uninstalling keyring can be a workaround.Ariose
I opened the issue in pgcli to track this: github.com/dbcli/pgcli/issues/920. It's better to move the conversation there.Ariose
A
5

We fixed the problem in v1.10.1, but right now you still need to pip install keyrings.alt package for things to work. There's an open PR to handle things better and make keyring package optional. As soon as that's merged, we'll do another bugfix release. Stay with us - and thank you for using pgcli!

Ariose answered 23/7, 2018 at 22:31 Comment(5)
How do I install such package? Run pip install keyring.alt? I like pgcli very much !Echolalia
Yes, exactly. But v1.10.2 is now out as well. You should not need keyring at all once you install that.Ariose
pip2 install keyring.alt and pip3 install keyring.alt result in error like Collecting keyring.alt Could not find a version that satisfies the requirement keyring.alt (from versions: ) No matching distribution found for keyring.alt Ideate
There was a spelling mistake above, it's pip install keyrings.alt with the extra sPeriodontics
This worked for me on ubuntu, but the password is not encrypted I guess, but I can lice with thatAlkalify
A
0

v1.10.2 is now out, with keyring optional. Using pgcli on a headless system should not be a problem anymore.

Ariose answered 24/7, 2018 at 4:44 Comment(8)
I have upgraded to v1.10.2. The "No handlers ..." message is gone, but everytime I run pgcli it keeps asking me "Please enter password for encrypted keyring:". I do not see there any option to disable the use of keyring in the updated pgcli. Please, clarify how can I avoid using keyring. ThanksEcholalia
I have configured the keyring = False under [main] in ~/.config/pgcli/config but still asks me for the encrypted keyring password. I even deleted ~/.local/share/python_keyring/crypted_pass.cfg and then when running pgcli I get the prompt "Please set a password for you new keyring:".Echolalia
Only if I create/edit the file ~/.local/share/python_keyring/keyringrc.cfg with the entry [backend] \n default-keyring=keyrings.alt.file.PlaintextKeyring, then it still uses keyring (and keyring.alt) but the backend does not require a password, so the previous prompt does not appear. HOWEVER, pgcli is still using keyring. Please, check again this situation in pgcli, so that the keyring = False is really working.Echolalia
I'll take a look. Quick question - do you still have keyring package installed? You need to uninstall it (pip uninstall keyring) so that pgcli won't try to use it.Ariose
Yes, I have installed keyring (10.1) and keyrings.alt (1.3).Echolalia
Humm ... But uninstalling keyring is not a solution because other applications may require it. The keyring = False under [main] should be the solution, or an option in the pgcli command-line executable to turn off keyring usage.Echolalia
Yes, I'm looking into why keyring = False does not work. But in the meantime, uninstalling keyring can be a workaround.Ariose
I opened the issue in pgcli to track this: github.com/dbcli/pgcli/issues/920. It's better to move the conversation there.Ariose

© 2022 - 2024 — McMap. All rights reserved.