Skip to content

Commit failed error with GPG signing turned on #1391

Closed

Description

@bwestover

Description

I recently started seeing this with the atom/github package as well. See that report for more details: atom/github#737

When I try to make a commit I get an error message:

Commit failed - exit code 128 received, with output: 'error: cannot run gpg: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object'

Version

GitHub Desktop version: 0.0.37

OS version: OS X El Capitan (10.11.6)

Steps to Reproduce

  1. Make a change to a file in a repository
  2. Type a commit message
  3. Click Commit button
  4. Error Message:
    image

Expected behaviour: I expect the commit to succeed.

Actual behaviour: I get the above error message, changes remain in the Changes tab and are not committed.

Reproduces how often: 100%

Logs

I couldn't find log files for Desktop beta. Are there any?

Additional Information

I have git configured to sign every commit:

$ git config --global --get commit.gpgsign
true

And my git version:

$ git --version
git version 2.12.0

Activity

  1. shiftkey commented on May 6, 2017

    @shiftkey
    Member

    @bwestover thanks for the report - #78 has been opened but not prioritized yet.

    I'm not sure whether there's some quick wins for us to support existing setups - I gather gpg is on your PATH, but I suspect there's more work we need to do here.

  2. bwestover commented on May 6, 2017

    @bwestover
    Author

    I gather gpg is on your PATH, but I suspect there's more work we need to do here.

    Yes, and I have a gpg-agent working with my stored passphrase. It works on the command-line without any intervention and all my commits are signed.

    $ git commit -m "A test commit"
    
    You need a passphrase to unlock the secret key for
    user: "Brett Westover <[email protected]>"
    4096-bit RSA key, ID 6D34F71F, created 2016-03-24
    
    [test-branch d9bbc5bbe8] A test commit
     1 file changed, 0 insertions(+), 0 deletions(-)
     create mode 100644 test
    

    As you can see, there is a gpg step in that commit, but it doesn't require any intervention from me.

    I'm suspicious that a recent update to dugite might be at fault. I got a similar error in the atom/github package, which I understand uses that package as well?

    The error there was:

    exited with code 128 
    stderr: error: gpg failed to sign the data
    fatal: failed to write commit object'
    

    It came on suddenly without any other changes to my local environment, but it was after installing an update which contained a bump of the dugite package.

  3. bwestover commented on May 6, 2017

    @bwestover
    Author

    In case it helps someone, the workaround I'm using for now is to disable gpg signing with a repository level git config.

    From within the repo path where I want to disable automatic gpg signing:

    $ git config commit.gpgsign false
    
  4. bwestover commented on May 10, 2017

    @bwestover
    Author

    I don't know if this applies here or not, but my issue in the atom/github package (atom/github#737) was resolved in atom/github#765 by ensuring that the PATH variable made it to the shell out strategy.

    Since the error I get in TNG is the same, maybe a similar solution could apply here?

  5. joshaber commented on May 10, 2017

    @joshaber
    Contributor

    Yup, it seems very likely that's the problem here too 👍 Thanks for the heads up!

  6. added
    bug
    on May 16, 2017
  7. mysticatea commented on May 17, 2017

    @mysticatea

    I have encountered this problem, too.
    The previous official GitHub Desktop for Windows (https://windows.github.com/) is working well.

    Version

    GitHub Desktop version: 0.5.3
    OS version: Windows 7 pro

  8. added a commit that references this issue on May 17, 2017
    c1e0b2c
  9. EtherTyper commented on May 17, 2017

    @EtherTyper

    @bwestover That is the problem! 😃 I used the same fix in #1578, and now GPG signing works.

  10. joshaber commented on May 26, 2017

    @joshaber
    Contributor

    I'm gonna roll this into #1796 so that we can track the underlying cause.

  11. locked as resolved and limited conversation to collaborators on Jul 22, 2018
  12. unlocked this conversation on Sep 27, 2018
  13. HajarElkoumikhi commented on Mar 18, 2019

    @HajarElkoumikhi

    I tried this out and it works !

    git config --global commit.gpgsign false

  14. marchershey commented on Dec 12, 2019

    @marchershey

    ^ Unfortunately, that's not what most of us are after. We want to sign our commits, and that is just turning it off. If you're not worried about it, then yes, use that command to disabled commit signing.

  15. rcnsh commented on Jun 9, 2020

    @rcnsh

    Any update on this? I have the same error and apart from turning of commit signing, there's not much I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions