gpg-agent only works when started in terminal

Daniel Kahn Gillmor dkg at
Mon Sep 12 02:52:25 CEST 2016

Hi Antony--

On Thu 2016-09-08 00:44:34 +0200, Antony Prince wrote:

> I know this has got to be something simple. When invoking gpg2 normally
> to decrypt, I get:
> gpg: encrypted with 4096-bit RSA key, ID 0E98CD22ADB13E99, created 2015-05-06
>       "Antony Prince <antony AT>"
> gpg: public key decryption failed: No pinentry
> gpg: decryption failed: No secret key
> I have pinentry-program set properly in ~/.gnupg/gpg-agent.conf.
> If I do:
> killall gpg-agent
> gpg-agent --daemon /bin/sh
> The pinentry appears as it should and all is fine.

A few diagnostic questions might help other folks on this list point you
in the right direction:

this command should not cause the pinentry to appear; what command are
you running that actually causes pinentry to appear?  what operating
system are you running?  are the gnupg packages supplied by the OS or
have you built them by hand?

what does the output of the following command show?

   gpg --list-secret-keys 0E98CD22ADB13E99

how about:

   gpg --version

(you've already showed gpg2 --version which reports 2.1.15, but plain
gpg might show something different)

What do you have pinentry-program set to in gpg-agent.conf?

If it turns out that gpg is version 1.4, and has access to the secret
key, but 2.1.15 does not, then you can try importing your secret keyring
into your 2.1.15 secret keyring to solve the problem.  That'd look
something like:

   gpg2 --import < ~/.gnupg/secring.gpg

hope these questions and suggestions are useful.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 930 bytes
Desc: not available
URL: </pipermail/attachments/20160912/f78fbc90/attachment.sig>

More information about the Gnupg-users mailing list