Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gpg failed to sign the data. Failed to write commit object

Tags:

I wrongly did sudo install gpg due to passphrase error. Now I am not able to commit anything through intelliJ. I am getting below error:

gpg: skipped "10XXXXXXXXX3892": secret key not available gpg: signing failed: secret key not available error: gpg failed to sign the data fatal: failed to write commit object 
gpg: skipped "MyUpdates": secret key not available gpg: signing failed: secret key not available error: gpg failed to sign the data fatal: failed to write commit object

Here two secret keys are shown "10XXXXXXXXX3892" and "MyUpdates". Is there any way i can get rid of gpg error. How can I uninstall gpg?

like image 820
Priyamvada Bhardwaj Avatar asked Aug 05 '16 03:08

Priyamvada Bhardwaj


People also ask

How do I fix GPG signing failed no secret key?

To fix the encountered “gpg: decryption failed: No secret key” error you can install the “pinentry-tty” program and add it to the gpg-agent configuration file.

How do you check if git commit is signed?

It's important that all commits to the git repository are signed. Use git commit --gpg-sign , or enable the commit. gpgSign configuration. Use git log --show-signature to check the signatures of commits.


1 Answers

This reads like a permissions problem. You likely created/installed the keys as another user than IntelliJ is running under. Given you run IntelliJ under your normal user account (which you generally should be doing), take ownership of the GnuPG home directory again:

sudo chown -R $USER:$USER ~/.gnupg

Then make sure you can see the private keys:

gpg --list-secret-keys
like image 105
Jens Erat Avatar answered Sep 22 '22 16:09

Jens Erat