Skip to content

Troubleshooting

Migration Fails

The initial migration ran past the default timeouts; or a previous migration or mirror of the same name failed during import.

pq: duplicate key value violates unique constraint "{DB TABLE}_pkey"

The DB sequential IDs have a new ID but not created, so creating a new key results in a duplicate unique key.

[git.timeout]
DEFAUlT = 360
MIGRATE = 1200
MIRROR = 1200
CLONE = 300
PULL = 300
GC = 60

Backup Forgejo and rebuild database tables.

forgejo dump -c /etc/forgejo/forgejo.ini -t /data/forgejo/tmp/ -V
forgejo doctor recreate-table -c /etc/forgejo/forgejo.ini

Mirror Fails with could not read Username

The source repository is no longer public or has been deleted.

[E] Failed to update mirror repository &{272 10 {USER} {REPO} {REPO} Mirror of https://github.com/{USER}/{REPO}.  2 https://github.com/{USER}/{REPO} master 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 true false false true 0 map[] map[] [] false 0 false 0 35674663 false false [] default  1582936274 1573978478}: Stdout: Fetching origin

Stderr: fatal: could not read Username for 'https://github.com': terminal prompts disabled error: Could not fetch origin

Err:

Disable sync by setting Migration Interval to 0.