Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Migrate from GitLab to Gitea fail "duplicate key value violates unique constraint "UQE_issue_repo_index"" #32910

Open
kittkott opened this issue Dec 19, 2024 · 6 comments
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug

Comments

@kittkott
Copy link

Description

Try to migrate from old GitLab Community Edition 11.4.5 to new Gitea installation.
Old Repo have zero Issues. I have check a box: Labels, Merge Request, Releases.

2024/12/18 17:55:14 ...ices/task/migrate.go:60:func1() [E] runMigrateTask[14] by DoerID[3] to RepoID[24] for OwnerID[12] failed: pq: duplicate key value violates unique constraint "UQE_issue_repo_index"
2024/12/18 17:55:14 ...ervices/task/task.go:53:handler() [E] Run task failed: pq: duplicate key value violates unique constraint "UQE_issue_repo_index"

Gitea Version

1.22.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.34.1

Operating System

Ubuntu 22.04.5 LTS

How are you running Gitea?

get from https://dl.gitea.com/gitea/1.22.6/gitea-1.22.6-linux-amd64
Systemd service from https://github.com/go-gitea/gitea/blob/release/v1.22/contrib/systemd/gitea.service

Database

PostgreSQL

@kemzeb kemzeb added the topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them label Dec 19, 2024
@lunny
Copy link
Member

lunny commented Dec 19, 2024

I think this is an known issue.

@kittkott
Copy link
Author

Some problems may be similar to "GitLab migrate merge requests + issues faile #13884". But I have zero "issues" in the GitLab repo.

@yp05327
Copy link
Contributor

yp05327 commented Dec 26, 2024

If there's a sample GitLab instance which can reproduce this issue....I have tried to deploy a GitLab with version 11.4.5, and created an empty repo with zero issues, and the migration is done. Maybe I need to use PostgreSQL instead of SQLite.
PostgreSQL also works.

@kittkott
Copy link
Author

May be version of PostgreSQL 16.6 may work incorrect?
I remove problem Merge Request, but problem still exist.
I cant public my gitlab instance.

From postgres log.
New error:
2024-12-28 10:45:00.614 MSK [456287] gitea@giteadb ERROR: duplicate key value violates unique constraint "UQE_issue_repo_index"
2024-12-28 10:45:00.614 MSK [456287] gitea@giteadb DETAIL: Key (repo_id, index)=(26, 1228) already exists.
2024-12-28 10:45:00.614 MSK [456287] gitea@giteadb STATEMENT: INSERT INTO "issue" ("repo_id","index","poster_id","original_author","original_author_id","name","content","milestone_id","priority","is_closed","is_pull","num_comments","ref","pin_order","deadline_unix","created_unix","updated_unix","closed_unix","is_locked") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19) RETURNING "id"

Errors before last try:
2024-12-18 11:46:06.984 MSK [300384] gitea@giteadb ERROR: duplicate key value violates unique constraint "UQE_issue_repo_index"
2024-12-18 11:46:06.984 MSK [300384] gitea@giteadb DETAIL: Key (repo_id, index)=(17, 1217) already exists.
2024-12-18 11:46:06.984 MSK [300384] gitea@giteadb STATEMENT: INSERT INTO "issue" ("repo_id","index","poster_id","original_author","original_author_id","name","content","milestone_id","priority","is_closed","is_pull","num_comments","ref","pin_order","deadline_unix","created_unix","updated_unix","closed_unix","is_locked") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19) RETURNING "id"

@kittkott
Copy link
Author

2024/12/28 10:45:00 ...ices/task/migrate.go:60:func1() [E] runMigrateTask[16] by DoerID[3] to RepoID[26] for OwnerID[12] failed: pq: duplicate key value violates unique constraint "UQE_issue_repo_index"
2024/12/28 10:45:00 ...ervices/task/task.go:53:handler() [E] Run task failed: pq: duplicate key value violates unique constraint "UQE_issue_repo_index"

@kittkott
Copy link
Author

Some observations: Problem always exist with last Merge Request (by index).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug
Projects
None yet
Development

No branches or pull requests

4 participants