Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: gpg failed to sign the data #24

Open
HofmannZ opened this issue Oct 21, 2017 · 7 comments
Open

Error: gpg failed to sign the data #24

HofmannZ opened this issue Oct 21, 2017 · 7 comments

Comments

@HofmannZ
Copy link

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?

@skrulcik
Copy link

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.

@przemyslawpluta
Copy link

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

@trinitronx
Copy link

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.

@wolfy1339
Copy link

wolfy1339 commented Feb 13, 2018

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

@jozefvaclavik
Copy link

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

@nmanikumar5
Copy link

This will help you to get rid of it

git config commit.gpgsign false

@jasonzhouu
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants