Upgrade from 1.4.3 to 1.5.2 fails (PostgreSQL 10.5) #2393

Closed
opened 2025-11-02 04:34:40 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @barthalion on GitHub (Oct 9, 2018).

Description

I am trying to upgrade my personal 1.4.3 instance to 1.5.2, unfortunately migrations fail as shown in the log gist above. The server runs Postgresql 10.5; I couldn't find any similar issue here (although I admit I could have missed it.)

Let me know if I can provide anything more to help with debugging.

Originally created by @barthalion on GitHub (Oct 9, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.4.3 / 1.5.2 - Git version: 2.19.0 - Operating system: Arch Linux ARM - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: https://gist.github.com/barthalion/65736b06046acde0284b0d65883f9f64 ## Description I am trying to upgrade my personal 1.4.3 instance to 1.5.2, unfortunately migrations fail as shown in the log gist above. The server runs Postgresql 10.5; I couldn't find any similar issue here (although I admit I could have missed it.) Let me know if I can provide anything more to help with debugging.
GiteaMirror added the type/bug label 2025-11-02 04:34:40 -06:00
Author
Owner

@lafriks commented on GitHub (Oct 9, 2018):

I have seen this error somewhere already. Try deleting data from team_unit table. (delete from team_unit;).

Important logfile part:

2018/10/09 20:31:25 [I] [SQL] SELECT "id", "org_id", "unit_types" FROM "team" LIMIT 100
2018/10/09 20:31:25 [I] [SQL] INSERT INTO "team_unit" ("org_id", "team_id", "type") VALUES ($1, $2, $3),($4, $5, $6),($7, $8, $9),($10, $11, $12),($13, $14, $15),($16, $17, $18),($19, $20, $21),($22, $23, $24),($25, $26, $27) []interface {}{2, 1, 1, 2, 1, 2, 2, 1, 3, 2, 1, 4, 2, 1, 5, 2, 1, 6, 2, 1, 7, 2, 1, 8, 2, 1, 9}
2018/10/09 20:31:25 [I] [SQL] ROLL BACK
2018/10/09 20:31:25 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Insert team units: pq: duplicate key value violates unique constraint "UQE_team_unit_s"
@lafriks commented on GitHub (Oct 9, 2018): I have seen this error somewhere already. Try deleting data from `team_unit` table. (`delete from team_unit;`). Important logfile part: ``` 2018/10/09 20:31:25 [I] [SQL] SELECT "id", "org_id", "unit_types" FROM "team" LIMIT 100 2018/10/09 20:31:25 [I] [SQL] INSERT INTO "team_unit" ("org_id", "team_id", "type") VALUES ($1, $2, $3),($4, $5, $6),($7, $8, $9),($10, $11, $12),($13, $14, $15),($16, $17, $18),($19, $20, $21),($22, $23, $24),($25, $26, $27) []interface {}{2, 1, 1, 2, 1, 2, 2, 1, 3, 2, 1, 4, 2, 1, 5, 2, 1, 6, 2, 1, 7, 2, 1, 8, 2, 1, 9} 2018/10/09 20:31:25 [I] [SQL] ROLL BACK 2018/10/09 20:31:25 [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: Insert team units: pq: duplicate key value violates unique constraint "UQE_team_unit_s" ```
Author
Owner

@barthalion commented on GitHub (Oct 10, 2018):

It worked, thank you!

@barthalion commented on GitHub (Oct 10, 2018): It worked, thank you!
Author
Owner

@lunny commented on GitHub (Dec 8, 2018):

Is this still a problem?

@lunny commented on GitHub (Dec 8, 2018): Is this still a problem?
Author
Owner

@barthalion commented on GitHub (Dec 8, 2018):

Upgrade from 1.5.x to 1.6 worked fine, no idea about 1.4 → 1.6.

@barthalion commented on GitHub (Dec 8, 2018): Upgrade from 1.5.x to 1.6 worked fine, no idea about 1.4 → 1.6.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2393