mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 02:24:21 -05:00
Migration issues from 1.14.4 to 1.15.0 on task table #7757
Closed
opened 2025-11-02 07:35:39 -06:00 by GiteaMirror
·
7 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.5
v1.16.4
v1.16.3
v1.16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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
issue/needs-feedback
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#7757
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 @anderson-dev on GitHub (Aug 26, 2021).
Unfortunately, I mistakenly deployed my team's instance of Gitea using the 'latest' tag of the official Gitea docker image around 3-4 months ago (I believe it was around version 1.14.2 at that time) thinking it was the latest stable release rather than an unstable dev version. I upgraded to the stable gitea/gitea:1.14.4 about 2 months ago. It required me to force migrate the underlying sqlite db in order for it to take. My hope was that some of the extra fields it added, but didn't use yet, would simply be used properly upon upgrade to the next release version. Yesterday I backed up my volume and attempted to upgrade to 1.15.0 but it failed during db migration.
What is the simplest way to ensure I'm back to the correct db schema version? Should I just blast away the volume, start with a fresh install, re-configure, and re-push all local repos to the new installation?
[x]):@zeripath commented on GitHub (Aug 26, 2021):
Although most of the warnings
... task has column xmessages are expected:This one is not.
There should not be a
messagecolumn intask.There is no code that would have added this so I don't know how it could be there. 2 options:
gitea doctor recreate-table taskwhich should remove the problem column and then reattempt migration.@lunny commented on GitHub (Aug 27, 2021):
Or you can just drop column
messageintasktable and try again. Please back up before you do any change in production environment.@tacerus commented on GitHub (Aug 28, 2021):
I think my issue might be related.
I had one failed migration attempt. After rolling back I attempted it again, and received this:
I stopped Gitea and inspected the database...
The gitea.tasks table looked like this:
Hence I removed the "ghost"-column, as suggested:
... and started Gitea again.
The migrations continued and Gitea started back up with 1.15.0.
My "500 issue" from #16725 came back into action however.
I hope I do everyone a favor by using a Pastebin for the trace-log instead of extending this already long comment:
https://pasta.lysergic.dev/?6c1b79c0de06b567#7cqeueQrpzupubyJk6nbz5UiAwj4bN1nq7yAHH4Mdx1C
@anderson-dev commented on GitHub (Aug 30, 2021):
Migration appears successful however I still notice a few quirks that still exist:
@tacerus commented on GitHub (Sep 11, 2021):
I just attempted the upgrade again with v1.15.2. Out of the box, similar errors about the column
messageappeared:I again applied the "patch" from my last comment. It again allowed the database migrations to finish running, but this time did not cause any 500 errors.
Since it seems to be working this way, I will not downgrade again, but can someone confirm if this "patch"ed database is fine to be used, or if there is something possible trying to use this
messagecolumn I removed in the future / in some feature?@zeripath commented on GitHub (Sep 11, 2021):
It's fine.
The message field shouldn't have been present in the task table in the first place. I'm not sure how it got there - did you run a dev version on this db at some point? The Errors field in that task table has now been renamed to message and everything will work fine from now on.
Similarly the primary key problem coming back doesn't make any sense at all. Did you migrate using 1.15.0 and 1.15.2? You should just migrate using version 1.15.2 - once we release 1.15.y you shouldn't use 1.15.x where x<y. If you use 1.15.0 you're not going to get any of the fixes we make to migrations in say 1.15.6.
You're fine though. Just run the doctor recreate-table command for the issue_index primary key problem and you're done.
But for anyone else watching:
If you are on 1.14.3-1.14.6 because there was a bug in the dump command in these versions: if you backup your db using dump then you need to migrate to 1.14.7 to get a dump before you upgrade to 1.15 - but even then do not do 1.14.3,1.14.4,1.14.5,1.14.6,1.14.7 just go straight to 1.14.7 - make the dump and thence straight to 1.15.2.
So what do you do if you are on 1.13.x or lower?
Backup your db and go straight to 1.15.2 (or 1.15.x where X is the largest point release). That's it. Read the breaking notes for 1.14.0 and 1.15.0 on the blog though.
You can if you prefer go via 1.14.7 but you don't need to and from 1.15.3 that's a dead branch. Do not go via 1.14.0 etc - because if you do that you are needlessly exposing yourself to any bugs in migrations in 1.14.0 (which IIRC there were).
You get one shot at each migration.
We will mitigate bugs in migrations but better will fix them in the code so future users don't experience them. By going via out of date point releases you are needlessly exposing yourself to old bugs in these and preventing us from fixing things.
@anderson-dev commented on GitHub (Oct 29, 2021):
Just wanted to mention, after correcting the table schema as suggested, I still experienced small issues such as in-code review not being viewable by others. As a result, I ended up having to export all repos, start from scratch with a stable version of gitea, recreate/reconfigure all orgs and settings, reimport all repos, recreate all users/permissions, and reconfigure all repos. We lost all of our pr history but now we are confident in our foundations on a stable Gitea environment rather than the one that started as a dev build and things are working much more reliably.
I’ll be much more careful whether Docker latest is considered dev or stable in the future for other software. Also thanks for your great efforts @zeripath to help us through these partial migrations and hopefully your recent code fix reduces the chance of users falling through the cracks like we did.