gitea icon indicating copy to clipboard operation
gitea copied to clipboard

refs/ are not updated

Open camlafit opened this issue 1 year ago • 1 comments

Description

Hello

In some cas refs in bare repository are not updated. Since some weeks we have trouble when user try to push force or rebase any branch (main or dev branches)

## git remote add origin [email protected]/spip/spip/
## git [....]
## git push -f dev/instituer_ergo
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Visit the existing pull request:
remote:   https://git.spip.net/spip/spip/pulls/196
remote:
remote: . Processing 1 references
remote: Processed 1 references in total
To git.spip.net:spip/spip.git
 + f7124113c...434aff617 dev/instituer_ergo -> dev/instituer_ergo (forced update)

$ git lg -1
* 434aff617 - (HEAD -> dev/instituer_ergo, origin/dev/instituer_ergo) Suivre la proposition d'erational de ne mettre un fond que sur le statut lui-même sans le label (RastaPopoulos 76 minutes ago)

But in server repositories/spip/spip.get/refs/heads/dev/instituer_ergo was targeted to f7124113c To update the change I've updated the file to 434aff617

file state to this file looks correct Accesx : (0644/-rw-r--r--) UID : ( 1001/ git) GID : ( 1001/ git)

We have got some other trouble from webui with rebase/push commit or any other push on this repository. Other repositories don't look get this trouble.

Could be similar to https://github.com/go-gitea/gitea/issues/4835

Gitea Version

1.19.2 , 1.21.4

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

2.39.2-1.1

Operating System

Debian 12.2 / Mariadb 1:10.11.4-1~deb12u1

How are you running Gitea?

giteas is build from source service is a xen instance domU

As we have an historic configuration with multiple instance we use script this script to start gitea :

su \
               -l git \
               -s /bin/bash \
               -c "GITEA_WORK_DIR=/var/git/gitea/$instance \
                       /usr/local/bin/gitea $MODE \
                       --custom-path /var/git/gitea/$instance/custom/ \
                       --config /var/git/gitea/$instance/config/app.ini \
                       --pid /var/run/git/gitea_$instance.pid &"

Database

MySQL/MariaDB

camlafit avatar Jan 30 '24 08:01 camlafit

Hello

To complete , next git push are accepted and followed by gitea. 3 commits were pushed and git bare/web ui are coherent with new reference 4c109e59fb0f05167a9500be035f81247dcf3c59

camlafit avatar Jan 30 '24 09:01 camlafit

Hello

To complete, the git bare log (in log/refs/heads/dev/instituer_ergo) related to this behavior.

f7124113cb7834a4e314ebd3067574477e93b341 434aff617ef5aa3b54d0d360e7978e39ae801f1c Gitea <[email protected]> 1706549422 +0100     push
434aff617ef5aa3b54d0d360e7978e39ae801f1c f7124113cb7834a4e314ebd3067574477e93b341 Gitea <[email protected]> 1706549424 +0100     update by push

We can see a rollback to previous commit with an update by push action.

In other case we have also lost two commits. To restore them I've forced value in refs/heads/master Following git bare refs/heads/master log we have this :

c772b7c5c951774640d96f32a484168a38a05cf3 e115480d9b1aa72cf41fc2aff868036e1108a13a marcimat <[email protected]> 1706784210 +0100     push
e115480d9b1aa72cf41fc2aff868036e1108a13a 48af8183a9eceed7564115cb3a304ec6742249ba Gitea <[email protected]> 1706833805 +0100     push
48af8183a9eceed7564115cb3a304ec6742249ba b6d29595160f418c1a7d71b8d7090bf556802794 Gitea <[email protected]> 1706833810 +0100     push
b6d29595160f418c1a7d71b8d7090bf556802794 385178b03569f33c6177ebd52f536826d121dcae Gitea <[email protected]> 1706833815 +0100     push
385178b03569f33c6177ebd52f536826d121dcae e115480d9b1aa72cf41fc2aff868036e1108a13a Gitea <[email protected]> 1706833834 +0100     update by push

Initial state was as c772b7c and gitea was coherent. An user has push some commits with its token authentication to 385178b. And after for any reason we have a rollback to previous commit c772b7c

camlafit avatar Feb 03 '24 21:02 camlafit

Hello

Trouble looks occured this morning https://git.spip.net/spip/spip/pulls/5853

Restore with a manual rewrite on repository to retarget correct hash on master head

camlafit avatar Feb 12 '24 22:02 camlafit