Skip to content

Push update failed when git tag reference to a blob  #23213

Closed
@adlternative

Description

@adlternative

Description

When I push git source code repository to gitea, I found gitea server log turn out error:

[E] pushUpdate failed: gitRepo.GetCommit(3a1c74404d544d20c0d1f0b9c072b471a20b04c0) in cool/git2[4]: object does not exist [id: 7214aea37915ee2c4f6369eb9dea520aec7d855b, rel_path: ]

So I check and find out that this object is a special tag which reference to a blob:

git cat-file -p 3a1c74404d544d20c0d1f0b9c072b471a20b04c0
object 7214aea37915ee2c4f6369eb9dea520aec7d855b
type blob
tag junio-gpg-pub
tagger Junio C Hamano <gitster@pobox.com> 1416525135 -0800

GPG key to sign git.git archive

This blob contains the GPG public key I use to sign git.git archive.

To use it to verify tags I signed, do:

  $ git-cat-file blob junio-gpg-pub | gpg --import

to import it into your keyring, and then

  $ git-tag -v $tag_to_be_verified

The fingerprint information for the key is as follows:

$ gpg --fingerprint -k 96AFE6CB\!
pub   4096R/713660A7 2011-10-01
      Key fingerprint = 96E0 7AF2 5771 9559 80DA  D100 20D0 4E5A
      7136 60A7
uid                  Junio C Hamano <gitster@pobox.com>
uid                  Junio C Hamano <junio@pobox.com>
uid                  Junio C Hamano <jch@google.com>
sub   4096R/833262C4 2011-10-01
sub   4096R/96AFE6CB 2011-10-03 [expires: 2015-09-21]
sub   4096R/B3F7CAC9 2014-09-20 [expires: 2017-09-19]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAABAgAGBQJUbnV7AAoJELC16IaWr+bLvjYP+wSOG8rp1y77ExHDJQj7HBLm
9PVQIb70tkiBxAGUpVNNbaoJQBuMAgFdT4Baj8CIo2jdzDeeqbjtcdy/XsHZ3IMl
7VRm9cI8Veh5nPc9U3z6XYTMmDhxxSsnCONQECYYFEJ5QGhnwkpOUTDYPRmnghWu
4JSDyWX0RLNXVPZkoP/zwVbv74Exx1Gz24p6fPlc4iETrKNHzzSM07CPKlAmXRHT
Ozh/NXfiE3OZSFDUNKkzHQJHtyFEPpVw/aUIyObvOcSYy6ZxQ+56U9h24D1mW8kY
w8BPdhzQ5d9nB/zpX83/cqsv6IXsK62ls8Qj51MfNM902D0pghVBInjR2xekWx+b
AO5VMaRiC+hgHvyzAM2nXuDfTUssd9ryYIx/plfw0gcKZ41S3HzHTiXYqRqd4O4I
lkFlWL11no7od+T9T2nap5wfdLliQpMxxZFLsqH67LzAvHxg/NjtIMXDxUfo++tV
qBR153FxcJX8AOcQo3zY7WotbmgS+8JPron3XvjXNOlz9HAxR2+orxhEC3pTVfeC
/aEZzs+ub9pV6ZQzVdfHzRZbtiN4Zw2ycW+EoXvlUCwNy72efaBRpKjQl4zJHKfD
LAwljdrenm8X6RjBKd/vPyTPSHx1AtSoXqseVw8Ly+qqoXnhsh2N0Xe2Ozx3D0lk
PtscHvD+diDMRLbLgK/k
=Sxgg
-----END PGP SIGNATURE-----

This made me realize that gitea may not consider the ref references to other blobs/trees at all. Since the error occurs in the post-receive-hook, this error may cause some notifications to be lost.

A simple workaround might be to skip this specially referenced webhook, this at least won't let us lose the webhook for common references.

But a more complete approach may be to modify the content of the notification, make it compatible with this special reference.

Gitea Version

3e426bb

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

2.34.1

Operating System

archlinux

How are you running Gitea?

command-line

Database

MySQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions