mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-07 12:37:43 -05:00
[GH-ISSUE #263] Repos got created first time but then are not syncing #1986
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @thisisjaymehta on GitHub (Apr 11, 2026).
Original GitHub issue: https://github.com/RayLabsHQ/gitea-mirror/issues/263
Originally assigned to: @arunavo4 on GitHub.
I installed forgejo and gitea-mirror
The I configured sync and repos got synced the first time.
But then they are not being updated with latest commits from github.
I can see following error in logs:
Stderr: fatal: could not read Password for 'https://sanitized-credential@github.com': terminal prompts disabled
However I can see my github connection is working fine when I do "Test Connection" in gitea-mirror
@arunavo4 commented on GitHub (Apr 13, 2026):
@thisisjaymehta This should be partially addressed in #266. The fix ensures auth credentials are always sent during migration (not just for private repos), which prevents the "terminal prompts disabled" error for newly mirrored repos.
One caveat — repos that were already migrated without credentials can't be fixed via the API (Gitea/Forgejo doesn't support updating mirror credentials through PATCH). For those, you'll need to delete and re-mirror them so the credentials get stored properly.
You can test with the PR image:
ghcr.io/raylabshq/gitea-mirror:pr-266@thisisjaymehta commented on GitHub (Apr 25, 2026):
Hi @arunavo4 , thanks. But I updated to v3.15.2, deleted all repos and mirrored them again. They got mirroerd fine but the sync still fails.
Error:
@arunavo4 commented on GitHub (Apr 26, 2026):
@thisisjaymehta Update after a deeper investigation:
This turned out to be an upstream Forgejo bug, not something we could fix on the gitea-mirror side. The credentials sent via Forgejo's
/api/v1/repos/migrateAPI were used only for the initial clone (via a temp credential helper) and then discarded — they were never persisted anywhere, so subsequent mirror sync had no password and failed exactly as you saw withterminal prompts disabled.Reproduced in Forgejo source and confirmed live against v12.0.4, v13.0.5, v14.0.4, and v15.0.0 side by side:
repo_model.InsertMirror(ctx, &mirrorModel)— stores the bare URL, no credsmirrorModel.InsertWithAddress(ctx, opts.CloneAddr)— encrypts the credentialed URL into the newEncryptedRemoteAddresscolumnForgejo fixed it in v15.0.0 via PR #11909 ("fix: store pull mirror creds encrypted with keying"). The fix was not backported to v12.x, v13.x, or v14.x — so any pre-v15 Forgejo will hit this regardless of point release.
Related upstream issues confirming the same root cause: #9629, #9503.
To fix your setup: upgrade your Forgejo to v15.0.0 or later, then delete and re-mirror the affected repos (existing mirrors created on the old version still won't have stored creds; only fresh migrations on v15+ will).
The next gitea-mirror release will detect this on connection-test and show an in-app warning when the connected server reports a Forgejo version below 15.0.0, so future users hit by the same bug find their way out faster.
Note: PR #266's earlier change (always sending auth fields, not gating on
isPrivate) is still correct — Forgejo does need them for the initial clone — but it couldn't fix subsequent sync because the bug was upstream.@arunavo4 commented on GitHub (Apr 26, 2026):
here is a preview of the simple warning added for forgejo versions without the fix