Mailing List Archive

keydb_search failed: Invalid argument
Hello!

I use Debian unstable+experimental. Debian unstable has gpg version 2.2.27, while Debian experimental has gpg version 2.3.1. I'm using gpg mainly in the context of pass (https://passwordstore.org), but also for encrypting files and such. Additionally, I use ProtonMail, and I have the bridge (https://protonmail.com/bridge) use pass to retrieve credentials.

With gpg version 2.2.27, everything works just fine - there are no warnings or errors and pass and ProtonMail bridge both work well. With gpg version 2.3.1, however, I run into a warning of "gpg: keydb_search failed: Invalid argument" whenever I attempt to decrypt a password with pass. pass also returns an error code of 2, which seems to be propagated from the gpg return value. Because of this, the ProtonMail bridge program believes that it was not able to retrieve the credentials and fails to load properly.

I saw another email on here with a "keydb_search: Broken pipe" message, but I wasn't sure if these are related or if there is something I have misconfigured. I don't really have control over how ProtonMail bridge calls pass, and I'm getting this error/warning even when I just decrypt an encrypted file using plain gpg.

Any help would be deeply appreciated!

Sincerely,

Chiraag
--
?????? ??????
Pronouns: he/him/his
Re: keydb_search failed: Invalid argument [ In reply to ]
Hello,

?????? ?????? wrote:
> I'm getting this error/warning even when I just decrypt an encrypted
> file using plain gpg.

If you keep using ~/.gnupg/pubring.gpg, I think this is the cause of
your problem.

In this case, see this comment in the bug tracker of GnuPG:

https://dev.gnupg.org/T5409#145906

To excerpt the solution from the comment, it's:
--------------------------
cd ~/.gnupg
gpg --export-options backup --export >allkeys.gpg
mv pubring.gpg pubring.gpg-saved
gpg --import-options restore --import <allkeys.gpg
rm allkeys.gpg
--------------------------
--

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: keydb_search failed: Invalid argument [ In reply to ]
12021/03/32 08:63.22 ?????, NIIBE Yutaka <gniibe@fsij.org> ??????:
> Hello,
>
> ?????? ?????? wrote:
> > I'm getting this error/warning even when I just decrypt an encrypted
> > file using plain gpg.
>
> If you keep using ~/.gnupg/pubring.gpg, I think this is the cause of
> your problem.
>
> In this case, see this comment in the bug tracker of GnuPG:
>
> https://dev.gnupg.org/T5409#145906
>
> To excerpt the solution from the comment, it's:
> --------------------------
> cd ~/.gnupg
> gpg --export-options backup --export >allkeys.gpg
> mv pubring.gpg pubring.gpg-saved
> gpg --import-options restore --import <allkeys.gpg
> rm allkeys.gpg
> --------------------------
> --

That worked perfectly, thank you!

Sincerely,

Chiraag
--
?????? ??????
Pronouns: he/him/his
Re: keydb_search failed: Invalid argument [ In reply to ]
On Thu 2021-06-03 09:43:02 +0900, NIIBE Yutaka wrote:
> ?????? ?????? wrote:
>> I'm getting this error/warning even when I just decrypt an encrypted
>> file using plain gpg.
>
> If you keep using ~/.gnupg/pubring.gpg, I think this is the cause of
> your problem.
>
> In this case, see this comment in the bug tracker of GnuPG:
>
> https://dev.gnupg.org/T5409#145906
>
> To excerpt the solution from the comment, it's:
> --------------------------
> cd ~/.gnupg
> gpg --export-options backup --export >allkeys.gpg
> mv pubring.gpg pubring.gpg-saved
> gpg --import-options restore --import <allkeys.gpg
> rm allkeys.gpg
> --------------------------
> --

In debian, we also ship a script
/usr/bin/migrate-pubring-from-classic-gpg which should perform a similar
approach (though it doesn't use the more recent mechanisms of
"--export-options backup"/"--import-options restore").

--dkg