git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Problem signing a tag

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Nov 4, 2009, 14:28 UTC
Message-ID
<4AF18F7A.2000904@drmicha.warpmail.net>
In-Reply-To
<200911030911.47030.joshua@eeinternet.com>
Joshua J. Kugler venit, vidit, dixit 03.11.2009 19:11:
Show 51 quoted lines
> On Monday 02 November 2009, Alex Riesen said something like:
>> On Tue, Nov 3, 2009 at 01:58, Joshua J. Kugler <joshua@eeinternet.com> 
> wrote:
>>> Nobody on the git IRC channel responded to this question, even
>>> after asking it a few times, so I thought I'd try here.
>>>
>>> I'm having trouble signing a tag.  I'm using this command:
>>>
>>> git tag -u EAFD344D14EA086E -F .git/TAG_EDITMSG tag_name
>>>
>>> I type in my passphrase, and am then told:
>>>
>>> error: gpg failed to sign the tag
>>> error: unable to sign the tag
>>>
>>> However, if I use this command:
>>>
>>> gpg -s -u EAFD344D14EA086E
>>>
>>> and use the same passphrase, it works fine. Is there any way to
>>> find out why a key-signing is failing?
>>
>> What does "echo $?" after it prints? IOW, maybe plain gpg fails too,
>> without printing anything special, and you don't pay attention to the
>> exit code. Git does. And it runs "gpg -bsau <key-id>".
> 
> $ git tag -s -F .git/TAG_EDITMSG tag_name
> 
> You need a passphrase to unlock the secret key for
> user: "Joshua J. Kugler <joshua@azariah.com>"
> 1024-bit DSA key, ID 14EA086E, created 2009-08-09
> 
> gpg: problem with the agent - disabling agent use
> error: gpg failed to sign the tag
> error: unable to sign the tag
> $ echo $?
> 128
> 
> And when I sign at the prompt:
> 
> $ gpg -sa
> 
> You need a passphrase to unlock the secret key for
> user: "Joshua J. Kugler <joshua@azariah.com>"
> 1024-bit DSA key, ID 14EA086E, created 2009-08-09
> 
> gpg: problem with the agent - disabling agent use
> Blah blah blah blah
> Blah blah blah blah
> $ echo $?
> 2
[...]
I assume you don't want to use gpg-agent, that should be the easy way out.

If gpg is trying to contact the agent it means that "use-agent" is set (from the config) and, probably, also that GPG_AGENT_INFO is set but no agent responds at that socket. (echo $GPG_AGENT_INFO)

Many distros set up this stuff automatically. Try unsetting both: unset GPG_AGENT_INFO gpg --no-use-agent ...

If that helps you can put "--no-use-agent" in your gpg config.
2 is a non-fatal error, 128 a fatal one, btw.
Michael
Previous: Joshua J. KuglerNext: Joshua J. Kugler
Message 4 of 10 in “Problem signing a tag”
  1. Joshua J. KuglerNov 3, 2009
  2. Alex RiesenNov 3, 2009
  3. Joshua J. KuglerNov 3, 2009
  4. Michael J GruberNov 4, 2009
  5. Joshua J. KuglerNov 4, 2009
  6. Michael J GruberNov 5, 2009
  7. Joshua J. KuglerNov 5, 2009
  8. Junio C HamanoNov 5, 2009
  9. Michael J GruberNov 6, 2009
  10. Joshua J. KuglerNov 9, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.