Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
AlexuDragon opened this issue Feb 22, 2022 · 5 comments
Closed

Comments

@AlexuDragon
Copy link

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

@AlexuDragon AlexuDragon changed the title Repo does not mirror automatically, only when using "Synchronise now" Repo does not mirror automatically, only works when using "Synchronise now" Feb 22, 2022
@peredin
Copy link

peredin commented 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
Copy link

peredin commented 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?

@markburgessstl
Copy link

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

@markburgessstl
Copy link

Seems to have been fixed in 1.16.2

@MaartenGrothus
Copy link

Same for me.

@lunny lunny closed this as completed Mar 14, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants