GPG fails during git commit

Viewed 295

I have gpg setup on my local machine and most of the time it works. But sometimes the commit takes about a minute and then fails. When commiting something I just get the output:

gpg: DBG: Not using CREATE_BREAKAWAY_FROM_JOB flag
gpg: can't connect to the agent: IPC connect call failed
gpg: keydb_search failed: No agent running
gpg: skipped "<mykeyid>": No agent running
gpg: signing failed: No agent running
error: gpg failed to sign the data
fatal: failed to write commit object

So I thought maybe there is no gpg agent running and I started one:

>gpg-agent --daemon --verbose
gpg-agent: a gpg-agent is already running - not starting a new one

Someone suggested on different threads that maybe my gpg versions mismatch or target different installations:

>gpg --version
gpg (GnuPG) 2.2.23-unknown
libgcrypt 1.8.7
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /c/Users/micha/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

>gpg-agent --version
gpg-agent (GnuPG) 2.2.23-unknown
libgcrypt 1.8.7
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

So the versions seem to be the same and the installation directory seems to be ok too:

>which gpg
/usr/bin/gpg

>which gpg-agent
/usr/bin/gpg-agent

For additional information: I'm running Windows 10 with gpg4win 3.1.16, commit using sublime merge or git cli.

>gpg --list-keys --keyid-format LONG
/c/Users/micha/.gnupg/pubring.kbx
---------------------------------
pub   ed25519/<mykeyid> 2021-03-02 [SCA] [expires: 2023-03-02]
      <someotherid>
uid                 [ unknown] <mymail1>
uid                 [ unknown] <mymail2>
sub   cv25519/<someotherid> 2021-03-02 [E] [expires: 2023-03-02]
0 Answers
Related