gitea: Migration failure 1.7.6->1.8.0: No such index: IDX_user_"idx_user_IDX_user_is_active"
- Gitea version (or commit ref): 1.7.6
- Git version: —
- Operating system: docker
- Database (use
[x]):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL)
- No
- Not relevant
- Log gist:
2019/04/23 11:48:27 [...itea/routers/init.go:82 GlobalInit()] [E] ORM engine initialization failed: migrate: do migrate: no such index: IDX_user_"idx_user_IDX_user_is_active"
2019/04/23 11:48:27 [I] Log Mode: File(Info)
2019/04/23 11:48:27 [I] XORM Log Mode: File(Info)
2019/04/23 11:48:27 [I] Cache Service Enabled
2019/04/23 11:48:27 [I] Session Service Enabled
2019/04/23 11:48:27 [I] Mail Service Enabled
2019/04/23 11:48:27 [I] Notify Mail Service Enabled
2019/04/23 11:48:27 [I] Beginning ORM engine initialization.
2019/04/23 11:48:27 [I] ORM engine initialization attempt #1/10...
2019/04/23 11:48:27 [I] Migration: add theme to users
2019/04/23 11:48:27 [I] Backing off for 3 seconds
2019/04/23 11:48:30 [I] ORM engine initialization attempt #2/10...
2019/04/23 11:48:30 [I] Migration: add theme to users
2019/04/23 11:48:30 [I] Backing off for 3 seconds
2019/04/23 11:48:33 [I] ORM engine initialization attempt #3/10...
2019/04/23 11:48:33 [I] Migration: add theme to users
2019/04/23 11:48:33 [I] Backing off for 3 seconds
...
Description
I made sure every version from 1.7.0 up to 1.7.6 was working. As soon as I upgrade from 1.7.6 to 1.8.0 I get the above error.
Indexes do exist and there’s also one for idx_user_IDX_user_is_active
$ sqlite3 gitea.db .indexes | grep user_is_active
idx_user_IDX_user_is_active
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (10 by maintainers)
Update to 1.8 was successful. Current version is 83.
@tadly so it looks like you had a particularly broken db, I’m not sure how. I don’t think
models/migrations/v78.gocould be responsible for that. Especially if the next migration in line fails too.Dropping all the indexes and recreating them should be fine though.
Therefore I’m going to close this issue - I’m also going to change the title as I don’t want people to refer to this unless they actually have a similar index problem - in which case we can reopen and reinvestigate.