Gitea downgrade from 1.17.0-rc1 to 1.16.9 on June 22, 2022

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.

image

image

As a consequence it is possible that a Gitea instance was downgraded instead of being upgraded. Here is an example:

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:

Discussion in the Gitea genera chatroom with @lunny suggests ~1,500 pulls happened when 1.16.9 was set to latest.