Mirror status stuck on syncing #140

Closed
opened 2026-10-05 01:44:14 +02:00 by adam · 5 comments
Owner

Hi, I've noticed that some repositories are stuck on "Syncing" status. Is there a clean way to restart this mirror/sync? What could cause this to be stuck?
My schedule is set to mirror every 4 hours. I'm mirroring those repos to Gitea. I'm on the newest update v3.20.4.

Image
Hi, I've noticed that some repositories are stuck on "Syncing" status. Is there a clean way to restart this mirror/sync? What could cause this to be stuck? My schedule is set to mirror every 4 hours. I'm mirroring those repos to Gitea. I'm on the newest update v3.20.4. <img width="1617" height="408" alt="Image" src="https://github.com/user-attachments/assets/68bd938b-a9ea-4975-bedb-24d446f29efd" /> <!-- github-sync-id:4837145640 -->
adam closed this issue 2026-10-05 01:44:14 +02:00
Author
Owner

Found the cause. If the app gets restarted mid-sync (update, OOM, reboot), the repo stays marked syncing in the DB and nothing ever picks it up again — the scheduler skips in-flight repos and the UI disables the sync button. Fixed in #347, stuck repos now reset themselves on startup and get retried.

To unstick right now on v3.20.4: stop the container and run

UPDATE repositories SET status='failed' WHERE status IN ('syncing','mirroring');

against data/gitea-mirror.db, then start it again. The repos will show a retry button and the next scheduled run picks them up.

After the next release your stuck repos should clear themselves on first boot — please give it a try and let me know.

Found the cause. If the app gets restarted mid-sync (update, OOM, reboot), the repo stays marked syncing in the DB and nothing ever picks it up again — the scheduler skips in-flight repos and the UI disables the sync button. Fixed in #347, stuck repos now reset themselves on startup and get retried. To unstick right now on v3.20.4: stop the container and run ```sql UPDATE repositories SET status='failed' WHERE status IN ('syncing','mirroring'); ``` against `data/gitea-mirror.db`, then start it again. The repos will show a retry button and the next scheduled run picks them up. After the next release your stuck repos should clear themselves on first boot — please give it a try and let me know. <!-- github-comment-id:4993720257 -->
Author
Owner

v3.21.0 is out — your stuck repos should clear themselves on first boot after upgrading, no manual steps needed. Let me know how it goes. https://github.com/RayLabsHQ/gitea-mirror/releases/tag/v3.21.0

v3.21.0 is out — your stuck repos should clear themselves on first boot after upgrading, no manual steps needed. Let me know how it goes. https://github.com/RayLabsHQ/gitea-mirror/releases/tag/v3.21.0 <!-- github-comment-id:4994245939 -->
Author
Owner

Hello, it looks like they are still getting stuck (I think). After fail I'm trying to sync them again but they seem to be stuck. In the repositories tab there is status "Syncing" on 4 repos but in the Activity Log there is no information on that.
There is only info saying that Mirroring is in progress:

Image When I look at the repo in Gitea it says for example "synced 1 hour ago". Image
Hello, it looks like they are still getting stuck (I think). After fail I'm trying to sync them again but they seem to be stuck. In the repositories tab there is status "Syncing" on 4 repos but in the Activity Log there is no information on that. There is only info saying that Mirroring is in progress: <img width="1596" height="317" alt="Image" src="https://github.com/user-attachments/assets/1a7b4020-0a10-42b8-a873-7eaa76983bab" /> When I look at the repo in Gitea it says for example "synced 1 hour ago". <img width="852" height="75" alt="Image" src="https://github.com/user-attachments/assets/08621912-34da-4a76-9c77-7e21e34046f0" /> <!-- github-comment-id:5067184743 -->
Author
Owner

@mike-m24 can you try on a fresh install with a fresh gitea, to rule out any other issue ? And try with the same repo that's getting stuck.

@mike-m24 can you try on a fresh install with a fresh gitea, to rule out any other issue ? And try with the same repo that's getting stuck. <!-- github-comment-id:5069844662 -->
Author
Owner

I’m not sure I can do that right now, as setting up a fresh install and a new Gitea instance would take a fair amount of time. Is there any workaround we could try first?

Also, I checked again and there is only this info in Activity log about Mirroring in progress, those 4 repos look like they're unstuck.

I’m not sure I can do that right now, as setting up a fresh install and a new Gitea instance would take a fair amount of time. Is there any workaround we could try first? Also, I checked again and there is only this info in Activity log about Mirroring in progress, those 4 repos look like they're unstuck. <!-- github-comment-id:5070031371 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/gitea-mirror#140