GPG failed to write commit object

综合技术 anicehumble (源链)

Got an error:

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

It took me more than two hours to narrow down the cause of the error:

These does not work too:

MacBook-Air:~ jack$ gpg2 --list-secret-keys
gpg: can't connect to the agent: IPC connect call failed
MacBook-Air:~ jack$ gpg-agent --daemon
gpg-agent[1499]: /Users/jack/.gnupg/gpg-agent.conf:2: invalid option

Error is caused by wrong configuration in gpg-agent.conf:

$ cat ~/.gnupg/gpg-agent.conf

For some reasons the second line was added to the configuration:

pinentry-program /usr/local/bin/pinentry-mac 
/usr/local/bin/pinentry-mac

That should just configured with this:

pinentry-program /usr/local/bin/pinentry-mac

After correcting the configuration, gpg-agent is now working:

MacBook-Air:~ jack$ gpg-agent -v --daemon
gpg-agent[2012]: listening on socket '/Users/jack/.gnupg/S.gpg-agent'
gpg-agent[2012]: listening on socket '/Users/jack/.gnupg/S.gpg-agent.extra'
gpg-agent[2012]: listening on socket '/Users/jack/.gnupg/S.gpg-agent.browser'
gpg-agent[2012]: listening on socket '/Users/jack/.gnupg/S.gpg-agent.ssh'
gpg-agent[2013]: gpg-agent (GnuPG) 2.1.21 started

And so is gpg2:

MacBook-Air:~ jack$ gpg2 --list-secret-keys
gpg-agent[2013]: handler 0x70000e9d4000 for fd 7 started
/Users/jack/.gnupg/pubring.gpg
------------------------------
sec   rsa2048 2016-12-12 [SC]

With that, committing with gpg signing shall work, must configure gpg to use gpg2 if it is not yet configured to gpg2:

MacBook-Air:~ jack$ git config --global gpg.program gpg2

Happy Coding!

您可能感兴趣的

GnuPG crypto library cracked, look for patches Linux users need to check out their distributions to see if a nasty bug in libgcrypt20 has been patched. The patch, which has landed in Debian...
SigSpoof 2: More ways to spoof signatures in GnuPG... This is another attack to spoof digital signatures specific to Enigmail. Previously, we showed how to spoof“encrypted” messages that were not ac...
研究人员已经在 GnuPG 加密库中实现 RSA-1024 破解... 目前,一群安全研究人员在 Gnu Privacy Guard(又名 GnuPG 或 GPG )加密库中发现了一个严重级别的漏洞(CVE-2017-7526)。利用该漏洞,攻击者就能破解 RSA – 1024 加密算法,并成功提取 RSA 密钥来进行数据解密。 漏洞关键 Gnu P...
An Advanced Intro to GnuPG I used to perceive PGP as an esoteric error-prone accessory to email. The talk below showed me that GnuPG is relevant to much more than emails. It giv...
如何解決 GPG 失效的問題? 我是用 cider 在管理自己的 dotfiles,然後前陣子因為 gnupg 的 formula 剛好一起被更新,導致我的 GPG signature verification 無法順利運作。 解決方式: $ brew unlink gnupg &&a...
责编内容来自:anicehumble (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » GPG failed to write commit object



专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录