[GH-ISSUE #263] Repos got created first time but then are not syncing #1986

Closed
opened 2026-05-03 02:56:11 -05:00 by GiteaMirror · 4 comments
Owner

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

Image
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 <img width="2806" height="1648" alt="Image" src="https://github.com/user-attachments/assets/a2987c29-bbb7-401e-a777-670b004b8a93" />
GiteaMirror added the documentationbugenhancement labels 2026-05-03 02:56:11 -05:00
Author
Owner

@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

<!-- gh-comment-id:4233881167 --> @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`
Author
Owner

@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:

Apr 25 06:35:05 general forgejo[678]: SyncMirrors [repo: <Repository 152:<hidden repo name for privacy>]: failed to update mirror repository:
Apr 25 06:35:05 general forgejo[678]: Stdout:
Apr 25 06:35:05 general forgejo[678]: Stderr: fatal: could not read Password for 'https://sanitized-credential@github.com': terminal prompts disabled
Apr 25 06:35:05 general forgejo[678]: Err: exit status 128
<!-- gh-comment-id:4318374006 --> @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: ``` Apr 25 06:35:05 general forgejo[678]: SyncMirrors [repo: <Repository 152:<hidden repo name for privacy>]: failed to update mirror repository: Apr 25 06:35:05 general forgejo[678]: Stdout: Apr 25 06:35:05 general forgejo[678]: Stderr: fatal: could not read Password for 'https://sanitized-credential@github.com': terminal prompts disabled Apr 25 06:35:05 general forgejo[678]: Err: exit status 128 ```
Author
Owner

@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/migrate API 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 with terminal 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:

  • v12 / v13 / v14: repo_model.InsertMirror(ctx, &mirrorModel) — stores the bare URL, no creds
  • v15.0.0+: mirrorModel.InsertWithAddress(ctx, opts.CloneAddr) — encrypts the credentialed URL into the new EncryptedRemoteAddress column

Forgejo 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.

<!-- gh-comment-id:4321598508 --> @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/migrate` API 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 with `terminal 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: - v12 / v13 / v14: `repo_model.InsertMirror(ctx, &mirrorModel)` — stores the bare URL, no creds - v15.0.0+: `mirrorModel.InsertWithAddress(ctx, opts.CloneAddr)` — encrypts the credentialed URL into the new `EncryptedRemoteAddress` column **Forgejo fixed it in v15.0.0** via [PR #11909](https://codeberg.org/forgejo/forgejo/pulls/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](https://codeberg.org/forgejo/forgejo/issues/9629), [#9503](https://codeberg.org/forgejo/forgejo/issues/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.
Author
Owner

@arunavo4 commented on GitHub (Apr 26, 2026):

Image

here is a preview of the simple warning added for forgejo versions without the fix

<!-- gh-comment-id:4321603321 --> @arunavo4 commented on GitHub (Apr 26, 2026): <img width="1914" height="912" alt="Image" src="https://github.com/user-attachments/assets/9ccfbd72-a5b7-4f0c-9bbb-d184c982e7fa" /> here is a preview of the simple warning added for forgejo versions without the fix
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea-mirror#1986