TL;DR: If a Gitea instance was downgraded to 1.16.9 June 22, 2022 around 00h15 UTC, and stopped working with Your database (migration version: 218) is for a newer Gitea, you can not use the newer database for this old Gitea release (211). upgrade to 1.17.0-rc1.
Around 00h15 UTC June 22, 2022, the latest tag in the docker hub was accidentally set to 1.16.9 (not yet released at the time). It was reset to 1.17.0-rc1 (eca3cc058158cd4e19e9a1d6ff4b22ce419dbf23e5b0e1b8dc6a80143712429a) a few minutes later.
As a consequence it is possible that a Gitea instance was downgraded instead of being upgraded. Here is an example:
- June 20, 2022: Gitea is updated using the latest docker image and is upgraded from 1.16.8 to 1.17.0-rc1
- The database is modified
- June 22, 2022: Gitea is updated using the latest docker image and is downgraded from 1.17.0-rc1 to 1.16.9
As a result the Gitea database is now in a state that is unknown to 1.16.9. Downgrading is not supported or tested and may lead to data corruption, reason why a safeguard was implemented to detect this case.
The Gitea logs will contain something like:
Your database (migration version: 218) is for a newer Gitea, you can not use the newer database for this old Gitea release (211).
Gitea will exit to keep your database safe and unchanged. Please use the correct Gitea release, do not change the migration version manually (incorrect manual operation may lose data).
2022/06/22 09:38:21 ...ations/migrations.go:462:Migrate() [F] Your database (migration version: 218) is for a newer Gitea, you can not use the newer database for this old Gitea release (211).
Gitea will exit to keep your database safe and unchanged. Please use the correct Gitea release, do not change the migration version manually (incorrect manual operation may lose data).
Received signal 15; terminating.
The recommended course of action is to:
- Update Gitea with 1.17.0-rc1
- Modify the upgrade procedure to no longer use the latest tag
- Verify Gitea works