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

mljrg
  • 4,430
  • 2
  • 36
  • 49

2 Answers2

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!

oligofren
  • 20,744
  • 16
  • 93
  • 180
j-bennet
  • 310
  • 3
  • 11
  • 1
    How do I install such package? Run `pip install keyring.alt`? I like `pgcli` very much ! – mljrg Jul 23 '18 at 23:26
  • Yes, exactly. But v1.10.2 is now out as well. You should not need `keyring` at all once you install that. – j-bennet Jul 24 '18 at 04:45
  • 5
    `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 ` – ibodi Sep 07 '18 at 08:59
  • 2
    There was a spelling mistake above, it's `pip install keyrings.alt` with the extra `s` – JedO Oct 12 '20 at 06:30
  • This worked for me on ubuntu, but the password is not encrypted I guess, but I can lice with that – Noufal E Feb 19 '21 at 17:50
0

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

j-bennet
  • 310
  • 3
  • 11
  • 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. Thanks – mljrg Jul 24 '18 at 07:57
  • 1
    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:". – mljrg Jul 24 '18 at 08:59
  • 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. – mljrg Jul 24 '18 at 09:06
  • 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. – j-bennet Jul 24 '18 at 14:32
  • Yes, I have installed `keyring (10.1)` and `keyrings.alt (1.3)`. – mljrg Jul 24 '18 at 14:38
  • 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. – mljrg Jul 24 '18 at 15:02
  • Yes, I'm looking into why `keyring = False` does not work. But in the meantime, uninstalling keyring can be a workaround. – j-bennet Jul 24 '18 at 15:11
  • I opened the issue in pgcli to track this: https://github.com/dbcli/pgcli/issues/920. It's better to move the conversation there. – j-bennet Jul 24 '18 at 15:16