keybase-gpg-github icon indicating copy to clipboard operation
keybase-gpg-github copied to clipboard

Error: gpg failed to sign the data

Open HofmannZ opened this issue 8 years ago • 7 comments

Hi,

I've followed the exact steps, but when I try to commit I get the following message:

error: gpg failed to sign the data
fatal: failed to write commit object

I made sure git us using the right PGP program, name and email. All matching the info in my GPG key.

Not quite sure what's going on, any suggestions?

HofmannZ avatar Oct 21 '17 19:10 HofmannZ

Try setting up your TTY, as seen in one of the optional sections of these instructions.

I had this problem as well (OSX 10.13, gpg (GnuPG) 2.2.1), and was able to find the solution in a comment on a related issue on the Keybase issues page. The underlying issue (apparent to me after trying echo "test" | gpg --clearsign) is actually with GPG, not with how Git is using it to sign.

skrulcik avatar Oct 31 '17 19:10 skrulcik

Had similar issue and running echo "test" | gpg --clearsign fixed if for a bit after reentering pass again.

przemyslawpluta avatar Jan 08 '18 19:01 przemyslawpluta

I've noticed with Yubikey 4 Nano, sometimes scdaemon gets into a borked state. It ends up yielding the same error when using signed commits.

Workaround that seems to fix it temporarily is:

# Kill any and all messed up scdaemon instances
ps auxww | grep -i scdaemon | grep -v grep | awk '{ print $2 }' | xargs kill
# Wait a sec
sleep 1
# Now re-init scdaemon by asking for card status
gpg2 --card-status

After this workaround, it should work again. Hope this helps fellow Yubikey users.

trinitronx avatar Jan 16 '18 00:01 trinitronx

I had this problem with git (although not with this plugin) and a google search for this problem led me here, with the comments here I got more info on the problem, it turns out there's an issue with keybase for this: keybase/keybase-issues#2798 and it contains a fix that works This problem is not caused by git or anything else but GPG itself

wolfy1339 avatar Feb 13 '18 01:02 wolfy1339

gpg --clearsign was working for me in terminal (after setting GPG_TTY), but I still couldn't commit through GUI (Git Tower).

Had to do:

echo no-tty >> ~/.gnupg/gpg.conf
git config --global gpg.program /usr/local/bin/gpg

jozefvaclavik avatar Jun 23 '18 08:06 jozefvaclavik

This will help you to get rid of it

git config commit.gpgsign false

nmanikumar5 avatar Jul 12 '18 10:07 nmanikumar5

run gpgconf --kill gpg-agent to kill any running agent that might be hung 2016-12 https://stackoverflow.com/a/41054093/7218912

This works for me.

jasonzhouu avatar Mar 12 '19 15:03 jasonzhouu