Git failed to sign commit

Phil's Avatar

Phil

13 Jan, 2017 11:36 PM

I used Yosemite. Upgraded to El Capitan, later updated GPG.
Now when I'm trying to sign commit, it fails:

$ git commit -S -m 'update' error: gpg failed to sign the data
fatal: failed to write commit object

Also when I run gpg:

$ gpg gpg: Go ahead and type your message ...
Test gpg

gpg: no valid OpenPGP data found.
gpg: processing message failed: Unknown system error

Expected
It should sign commits

macOS           10.11.6     15G1212
GPG Suite       2016.10     21  
GPGMail         2.6.2       1169
GPG Keychain    1.3.2       1245
GPGServices     1.11        916 
MacGPG2         2.0.30      884 
GPGPreferences  2.0.1       902 
Libmacgpg       0.7         775 
pinentry        0.9.7       4
  1. 1 Posted by Also Phil on 29 Jan, 2017 05:26 AM

    Also Phil's Avatar

    Did you end up figuring this out? Also having this same issue.

  2. 2 Posted by Phil on 29 Jan, 2017 05:21 PM

    Phil's Avatar

    No. Still broken, I spent couple hours trying to figure this out, but I'm so technically savvy about encryption utilities.
    I believe it is something withing GPG itself. I have plan to completely remove all gpg stuff and install it from scratch, but I don't want to because I'm afraid to lost keys etc.
    Also, Apple Mail signs emails so I'm sure it is something withing their command line utility. They have something interesting about sockets/pipes when encryption is happening. I suspect, they changed format or something like that.

  3. Support Staff 3 Posted by Luke Le on 22 Feb, 2017 04:42 PM

    Luke Le's Avatar

    Hi Phil,

    there seem to be conflicting version of gnupg installed on your system.
    From your debug info we see that you have at least gpg-agent installed in /opt/local/bin/gpg-agent
    As far as I remember macports used /opt/local for their tools, so you might want to uninstall gnupg from macports and only use ours.
    In addition it appears that there's something wrong with your gpg-agent.conf file
    Could you post that so we can have a look?

    Thanks.

  4. 4 Posted by Phil on 02 Mar, 2017 09:37 PM

    Phil's Avatar

    Hi Luke,

    I uninstalled gpg-agent, now Apple Mail cannot sign emails.

    $ gpg gpg: Go ahead and type your message ...
    fnngd
    fdmzgfd

    gpg: no valid OpenPGP data found.
    gpg: processing message failed: Unknown system error

    Looks like everything is broken.

  5. Support Staff 5 Posted by Luke Le on 29 Mar, 2017 04:22 PM

    Luke Le's Avatar

    Hi Phil,

    from the debug info it looks like the macports version of gnupg is heavily interfering with our version. It would be great if you could remove either the macpports version or our version and see if the problem still persists.

    The macports version also sets an environment variable for gpg-agent which is not at all what that environment variable should look like. Not sure why they're doing it, but it also prevents gpg-agent from functioning properly. We've seen a similar case with macports before.

  6. Support Staff 6 Posted by Steve on 24 May, 2017 05:21 PM

    Steve's Avatar

    Closing, since no further user feedback was received. Should your problem persist, feel free to re-open this discussion any time.

    All the best, steve

  7. Steve closed this discussion on 24 May, 2017 05:21 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac