I followed few articles over the pretty attributes on Git 2.10 release note. Going through which upgraded the git to 2.10.0 and made changes to global .gitconfig
This started happening all of a sudden for me on Ubuntu, not sure if some recent update did it, but none of the existing issues were applicable for me (I had GPG_TTY
set, tried killing the agent etc.). The standalone gpg
command was failing with this error:
$ echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
test
gpg: signing failed: Operation cancelled
gpg: [stdin]: clear-sign failed: Operation cancelled
I tried running gpg
with --debug-all
option and noticed the below output:
gpg: DBG: chan_3 <- INQUIRE PINENTRY_LAUNCHED 27472 gnome3 1.1.0 /dev/pts/6 screen-256color -
gpg: DBG: chan_3 -> END
gpg: DBG: chan_3 <- ERR 83886179 Operation cancelled
gpg: signing failed: Operation cancelled
The above indicates that there is some issue with the pinentry
program. Gpg normally runs pinentry-curses
for me, so I changed it to pinentry-tty
(I had to aptitude install
it first) and the error went away (though I no longer get the fullscreen password entry, but I don't like that anyway). To make this change, I had to add the line pinentry-program /usr/bin/pinentry-tty
to ~/.gnupg/gpg-agent.conf
and kill the agent with gpgconf --kill gpg-agent
(it gets restarted the next time).