Repo does not mirror automatically, only works when using "Synchronise now" #8601

Closed
opened 2025-11-02 08:12:07 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @AlexuDragon on GitHub (Feb 22, 2022).

Gitea Version

1.16.1 (latest-rootless docker image)

Git Version

2.30.2

Operating System

Whatever is inside that container

How are you running Gitea?

Docker latest-rootless from 6th of February.

Database

SQLite

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/AlexuDragon/510b139eb1f670609c591947916050a0

Description

I created a rule for mirroring with default 8h. Then I run synchronise just once so I won't wait 8 hours. Then I decided to delete it (since I couldn't edit it )and add the entry again with 1h timer. I noticed that the repo never syncs on its own, unless I manually click on "Synchronise now". Then I saw the logs, the one with "GetPushMirrorByID" repeats pretty much every 10 minutes. The other one containing "RemovePushMirrorRemote" probably was triggered when I removed the mirror entry, I'd guess that this step triggered the bug. I tried again to remove and re-add the mirror and same pattern happens. I'm guessing that manual Synchronising operates a bit different than the cron script that reads the info from wherever it is stored (SQLite?) before running the push operation. I didn't try this with the try.gitea as it uses a different dev version. I never submitted a bug, I can provide any addition information needed.

Thank you!!

Screenshots

No response

Originally created by @AlexuDragon on GitHub (Feb 22, 2022). ### Gitea Version 1.16.1 (latest-rootless docker image) ### Git Version 2.30.2 ### Operating System Whatever is inside that container ### How are you running Gitea? Docker latest-rootless from 6th of February. ### Database SQLite ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://gist.github.com/AlexuDragon/510b139eb1f670609c591947916050a0 ### Description I created a rule for mirroring with default 8h. Then I run synchronise just once so I won't wait 8 hours. Then I decided to delete it (since I couldn't edit it )and add the entry again with 1h timer. I noticed that the repo never syncs on its own, unless I manually click on "Synchronise now". Then I saw the logs, the one with "GetPushMirrorByID" repeats pretty much every 10 minutes. The other one containing "RemovePushMirrorRemote" probably was triggered when I removed the mirror entry, I'd guess that this step triggered the bug. I tried again to remove and re-add the mirror and same pattern happens. I'm guessing that manual Synchronising operates a bit different than the cron script that reads the info from wherever it is stored (SQLite?) before running the push operation. I didn't try this with the try.gitea as it uses a different dev version. I never submitted a bug, I can provide any addition information needed. Thank you!! ### Screenshots _No response_
Author
Owner

@peredin commented on GitHub (Feb 24, 2022):

It appears doMirrorSync in services/mirror/mirror.go calls SyncPushMirror passing mirror RepoID. In the end, this ends up in models/repo/pushmirror.go which looks up mirror information from the push_mirror table, but, instead looking at the idcolumn and not repo_id. To be continued.

@peredin commented on GitHub (Feb 24, 2022): It appears `doMirrorSync` in `services/mirror/mirror.go` calls `SyncPushMirror` passing mirror RepoID. In the end, this ends up in `models/repo/pushmirror.go` which looks up mirror information from the `push_mirror` table, but, instead looking at the `id`column and not `repo_id`. To be continued.
Author
Owner

@peredin commented on GitHub (Feb 24, 2022):

Further investigation shows that doMirrorSync uses SyncRequest which contains RepoId, this is passed in doMirrorSync (mirror.go) to SyncPushMirror (mirror_push.go) which expects mirrorId and not RepoId.

So the question is, should SyncPushMirror be changed to expect repoId, or SyncRequest to contain mirrorId?

@peredin commented on GitHub (Feb 24, 2022): Further investigation shows that `doMirrorSync` uses `SyncRequest` which contains `RepoId`, this is passed in `doMirrorSync` (mirror.go) to `SyncPushMirror` (mirror_push.go) which expects `mirrorId` and not `RepoId`. So the question is, should `SyncPushMirror` be changed to expect repoId, or `SyncRequest` to contain mirrorId?
Author
Owner

@markburgessstl commented on GitHub (Feb 24, 2022):

Same here. Push mirrors never sync unless manually. Gitea 1.16.1 on Windows with SQLite

@markburgessstl commented on GitHub (Feb 24, 2022): Same here. Push mirrors never sync unless manually. Gitea 1.16.1 on Windows with SQLite
Author
Owner

@markburgessstl commented on GitHub (Feb 25, 2022):

Seems to have been fixed in 1.16.2

@markburgessstl commented on GitHub (Feb 25, 2022): Seems to have been fixed in 1.16.2
Author
Owner

@MaartenGrothus commented on GitHub (Mar 14, 2022):

Same for me.

@MaartenGrothus commented on GitHub (Mar 14, 2022): Same for me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8601