0

The following simple command is failing

$  gpg --search-keys "hi"
gpg: error searching keyserver: Server indicated a failure
gpg: keyserver search failed: Server indicated a failure

Probably hi is not associated to a key, but still... shouldn't I get a does not exist error?

Therefore I think I'm misusing gpg command.

Oh, my version is gpg (GnuPG) 2.2.27.

0

For me, the "old" GnuPG (currently v1.4.23) works as expected:

$ /usr/bin/gpg --search-keys "hi"
gpg: searching for "hi" from hkp server pool.sks-keyservers.net
gpg: key "hi" not found on keyserver

I can reproduce your issue with gpg2 (2.2.27):

$ /usr/bin/gpg2 --search-keys "hi"
gpg: error searching keyserver: Server indicated a failure
gpg: keyserver search failed: Server indicated a failure

I can remediate the issue by explicitly declaring the keyserver to use:

$ /usr/bin/gpg2 --keyserver pool.sks-keyservers.net --search-keys "hi"
gpg: data source: http://[2a03:4000:8:5c9:a86d:e5ff:fea9:7bc4]:11371
gpg: key "hi" not found on keyserver
gpg: keyserver search failed: Not found

It seems like gpg2 does not like the old keyserver option. From man gpg2:

--keyserver name This option is deprecated - please use the --keyserver in ‘dirmngr.conf’ instead.

I'm not an expert on dirmngr and details about its conf file don't seem to be covered anywhere. I speculate it may be sufficient to add keyserver <preferred-keyserver> to ~/.gnupg/dirmngr.conf to permanently fix the gpg2 behaviour if you don't want to give the --keyserver option every time.

1
  • For some reason, when I use your command /usr/bin/gpg2 --keyserver pool.sks-keyservers.net --search-keys "hi" I still get the same error as with gpg --search-keys "hi". – Enlico Feb 4 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.