mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-16 04:42:51 -05:00
Migration failure 1.7.6->1.8.0: No such index: IDX_user_"idx_user_IDX_user_is_active" #3232
Closed
opened 2025-11-02 05:04:57 -06:00 by GiteaMirror
·
19 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.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rc3
v1.4.0-rc2
v1.3.3
v1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
No Label
type/bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#3232
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tadly on GitHub (Apr 23, 2019).
[x]):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@adelowo commented on GitHub (Apr 23, 2019):
Looks like this is https://github.com/go-gitea/gitea/pull/5681 but it was fixed not sure why this is happening ..
@tadly commented on GitHub (Apr 23, 2019):
Nope, not it especially as the error says:
no such index: IDX_user_"idx_user_IDX_user_is_active"I did try your suggestion anyways but again, didn't work.
The first
IDX_user_prefix seems to much. No idea where this one is coming from though.@adelowo commented on GitHub (Apr 23, 2019):
The log you pasted doesn’t contain anything related to indexes though
@tadly commented on GitHub (Apr 23, 2019):
Uhm the very first line?
specifically:
no such indexAnyways, the fact it says
"idx_user_IDX_user_is_active"is wrong already which I've manually fixed but it still prefixes it with an additionalIDX_user_.So currently I'm stuck at
while it should be just
IDX_user_created_unixWill have to investigate more some time later as I'm rather busy right now :(
@zeripath commented on GitHub (Apr 23, 2019):
OK let's try to figure out which migration is doing this. What's the version number of your database?
@tadly commented on GitHub (Apr 24, 2019):
Sorry for the delay. First of, I'm using the official docker image and am curious how the upgrade strategy for gitea usually is. Do you have to make sure you hit every version or could you (in theory) go from 1.7.0 straight to 1.8.0
As for the version,
77is what I get.Seems like I'm missing quite a bit... 78 - 84 ._.
As to how to apply them I'm not quite sure 🙄
@Cellebyte commented on GitHub (Apr 24, 2019):
Same here from 1.7.3 to 1.8 Docker image.
I will try to upgrade to 1.7.latest and then to 1.8 but i think the migrate is not working from 1.7 to 1.8
Tried it is not working.
@adelowo commented on GitHub (Apr 24, 2019):
Oh sorry, I was on mobile and didn't see that :)
@ChriFo commented on GitHub (Apr 24, 2019):
I am running v1.7.6 from Docker image with PostgreSQL.
Currently I am at version 77.
And I think I should wait with upgrade to 1.8 😃
@xor-gate commented on GitHub (Apr 24, 2019):
Same for me with Version 78.
b80d6490f3/models/migrations/v78.go (L37)@xor-gate commented on GitHub (Apr 24, 2019):
Fixed for me with:
@adelowo commented on GitHub (Apr 24, 2019):
Will send a fix after lunch
@ChriFo commented on GitHub (Apr 24, 2019):
Update to 1.8 was successful. Current version is 83.
@Cellebyte commented on GitHub (Apr 24, 2019):
Same here for MSSQL from 1.7.6 to 1.8 Docker image.
Cannot upgrade.
@adelowo commented on GitHub (Apr 24, 2019):
@lafriks Since my pr doesn't fix everything, can we reopen this? The original post says
ORM engine initialization failed: migrate: do migrate: no such index: IDX_user_"idx_user_IDX_user_is_active"@tadly commented on GitHub (Apr 24, 2019):
I do suspect that this is just my db being borked and not a general issue (the
IDX_user_"idx_user_IDX_user_is_active"thing)Still would appreciate it if anyone could help me fix this as doing a fresh setup would be rather tedious and time-consuming 😅
@zeripath commented on GitHub (Apr 24, 2019):
Try setting your version to 78 to skip the v78 migration - but do the work of the migration by hand.
@tadly commented on GitHub (Apr 25, 2019):
@zeripath Actually did that already but now gitea isn't doing anything on startup.
Nothing in the logs (even if I set the level to
Debug) and the version stays at 78 :/I ended up doing the most stupid thing I could think of (Spoiler, it's working now):
.indexesincluding the unique ones even though they would fail but I didn't care :D)SELECT sql FROM sqlite_master WHERE type == 'index';)database is locked(WhatTheHeckWhyNowAllOfASuddon.jpg)85nowI have this bad feeling that this isn't the last of it and that my db is quite messed up but that's not your guys fault.
Thanks for the help. I think we can close the issue again unless there are any objections?
@zeripath commented on GitHub (Apr 26, 2019):
@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.