Upgrading docker 1.9.6->1.10.0 - gitea fails to show page

I’m using gitea 1.9.6 with https in docker. I am trying to perform long postponed upgrade to 1.10.x (postponed because it didn’t work and I didn’t have time to troubleshoot). After updating the docker image, gitea shows error in browser ERR_CONNECTION_CLOSED.

The docker container log has repeated blocks like this:

2020-12-09 12:34:02,stdout,e[36m2020/12/09 12:34:02 e[0me[32mrouters/init.go:77:e[32mGlobalInit()e[0m e[1;36m[T]e[0m Log path: e[1m/data/gitea/loge[0m
2020-12-09 12:34:02,stdout,e[36m2020/12/09 12:34:02 e[0me[32mrouters/init.go:76:e[32mGlobalInit()e[0m e[1;36m[T]e[0m Custom path: e[1m/data/giteae[0m
2020-12-09 12:34:02,stdout,e[36m2020/12/09 12:34:02 e[0me[32mrouters/init.go:75:e[32mGlobalInit()e[0m e[1;36m[T]e[0m AppWorkPath: e[1m/app/giteae[0m
2020-12-09 12:34:02,stdout,e[36m2020/12/09 12:34:02 e[0me[32mrouters/init.go:74:e[32mGlobalInit()e[0m e[1;36m[T]e[0m AppPath: e[1m/app/gitea/giteae[0m
2020-12-09 12:34:02,stdout,"e[36m2020/12/09 12:34:02 e[0me[32m...dules/setting/git.go:87:e[32mnewGit()e[0m e[1;32m[I]e[0m Git Version: e[1m2.22.0e[0m, Wire Protocol e[1mVersion 2e[0m Enabled
"

The gitea.log is filled with blocks like this:

2020/12/09 12:32:28 routers/init.go:53:initDBEngine() [I] ORM engine initialization attempt #6/10...
2020/12/09 12:32:28 ...-xorm/xorm/engine.go:330:Ping() [I] PING DATABASE sqlite3
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? []interface {}{"version"} - took: 41.848µs
2020/12/09 12:32:28 ...m/dialect_sqlite3.go:260:IsColumnExist() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`id`%') or (sql like '%[id]%')) [version]
2020/12/09 12:32:28 ...m/dialect_sqlite3.go:260:IsColumnExist() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`version`%') or (sql like '%[version]%')) [version]
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 []interface {}{1} - took: 21.518µs
2020/12/09 12:32:28 ...ations/migrations.go:300:Migrate() [I] Migration[102]: update migration repositories' service type
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] PRAGMA index_list(`pull_request`) - took: 13.373µs
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_merged_unix`) - took: 11.912µs
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_merger_id`) - took: 9.625µs
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_has_merged`) - took: 9.26µs
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_base_repo_id`) - took: 9.737µs
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_head_repo_id`) - took: 11.897µs
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_issue_id`) - took: 9.928µs
2020/12/09 12:32:28 .../xorm/session_raw.go:76:queryRows() [I] [SQL] SELECT sql FROM sqlite_master WHERE tbl_name='pull_request' and type='table' - took: 22.273µs
2020/12/09 12:32:28 .../xorm/session_raw.go:194:exec() [I] [SQL] CREATE TABLE `new_pull_request_new` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `type` INT NULL, `status` INT NULL, `issue_id` BIGINT(20) NULL, `index` BIGINT(20) NULL, `head_repo_id` BIGINT(20) NULL, `base_repo_id` BIGINT(20) NULL,  NULL, `head_branch` VARCHAR(255) NULL, `base_branch` VARCHAR(255) NULL, `merge_base` VARCHAR(40) NULL, `has_merged` TINYINT(1) NULL, `merged_commit_id` VARCHAR(40) NULL, `merger_id` BIGINT(20) NULL, `merged_unix` BIGINT(20) NULL, `conflicted_files` TEXT NULL) - took: 22.485µs
2020/12/09 12:32:28 routers/init.go:59:initDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: migrate: do migrate: near "NULL": syntax error
2020/12/09 12:32:28 routers/init.go:60:initDBEngine() [I] Backing off for 3 seconds

It appears to be a database migration error. If I delete app.ini and database, and start from scratch - gitea works, but I obviously need my repository data.

Please help. Thanks!

It looks like it is the following migration that is failing: https://github.com/go-gitea/gitea/blob/c85bb6263503ebd335863f413214a775973a1fac/models/migrations/v102.go

Could you confirm the version information in your DB using:

SELECT `id`, `version` FROM `version`

I’m not really sure how to do this. Connected to the gitea.db through docker terminal, and the above command gives me “1|102”. Is that it?

That’s exactly what I was looking for thanks :slight_smile:

That confirms my suspicion above about which migration is failing, and we now have a place to start from.

Would you be able to take a backup, and try upgrading directly to the :1.11 image (or even perhaps directly to :1.13, there have been migration code refactors since 1.10 including upstream library updates which may be kinder on the upgrade process?

Tried upgrading directly to :1.11. Same result - in browser gitea shows nothing, and gitea.log is filled with blocks like this:

2020/12/10 12:15:10 ...rm.io/xorm/engine.go:351:Ping() [I] PING DATABASE sqlite3
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? []interface {}{"version"} - took: 48.992µs
2020/12/10 12:15:10 ...m/dialect_sqlite3.go:260:IsColumnExist() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`id`%') or (sql like '%[id]%')) [version]
2020/12/10 12:15:10 ...m/dialect_sqlite3.go:260:IsColumnExist() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? and ((sql like '%`version`%') or (sql like '%[version]%')) [version]
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 []interface {}{1} - took: 26.446µs
2020/12/10 12:15:10 ...ations/migrations.go:376:Migrate() [I] Migration[102]: update migration repositories' service type
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] PRAGMA index_list(`pull_request`) - took: 16.998µs
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_merged_unix`) - took: 12.622µs
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_merger_id`) - took: 11.132µs
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_has_merged`) - took: 11.342µs
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_base_repo_id`) - took: 12.38µs
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_head_repo_id`) - took: 15.348µs
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] PRAGMA index_info(`IDX_pull_request_issue_id`) - took: 19.207µs
2020/12/10 12:15:10 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT sql FROM sqlite_master WHERE tbl_name='pull_request' and type='table' - took: 24.227µs
2020/12/10 12:15:10 .../xorm/session_raw.go:196:exec() [I] [SQL] CREATE TABLE `new_pull_request_new` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `type` INT NULL, `status` INT NULL, `issue_id` BIGINT(20) NULL, `index` BIGINT(20) NULL, `head_repo_id` BIGINT(20) NULL, `base_repo_id` BIGINT(20) NULL,  NULL, `head_branch` VARCHAR(255) NULL, `base_branch` VARCHAR(255) NULL, `merge_base` VARCHAR(40) NULL, `has_merged` TINYINT(1) NULL, `merged_commit_id` VARCHAR(40) NULL, `merger_id` BIGINT(20) NULL, `merged_unix` BIGINT(20) NULL, `conflicted_files` TEXT NULL) - took: 23.591µs
2020/12/10 12:15:10 routers/init.go:72:initDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: migrate: do migrate: near "NULL": syntax error
2020/12/10 12:15:10 routers/init.go:73:initDBEngine() [I] Backing off for 3 seconds

Upgrading to :1.13 has exactly the same outcome. gitea.log shows:

2020/12/10 12:20:33 routers/init.go:82:initDBEngine() [I] ORM engine initialization attempt #7/10...
2020/12/10 12:20:33 ...rm/session_schema.go:25:Ping() [I] PING DATABASE sqlite3
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? [version] - 54.234µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT * FROM version LIMIT 0 [] - 21.545µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT * FROM version LIMIT 0 [] - 17.253µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 [1] - 24.647µs
2020/12/10 12:20:33 ...ations/migrations.go:336:Migrate() [I] Migration[102]: update migration repositories' service type
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] BEGIN TRANSACTION [] - 42.887µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] PRAGMA index_list(`pull_request`) [] - 14.882µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] PRAGMA index_info(`IDX_pull_request_merged_unix`) [] - 11.247µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] PRAGMA index_info(`IDX_pull_request_merger_id`) [] - 9.582µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] PRAGMA index_info(`IDX_pull_request_has_merged`) [] - 9.776µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] PRAGMA index_info(`IDX_pull_request_base_repo_id`) [] - 10.984µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] PRAGMA index_info(`IDX_pull_request_head_repo_id`) [] - 10.054µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] PRAGMA index_info(`IDX_pull_request_issue_id`) [] - 9.902µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT sql FROM sqlite_master WHERE tbl_name='pull_request' and type='table' [] - 23.272µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] CREATE TABLE `new_pull_request_new` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `type` INT NULL, `status` INT NULL, `issue_id` BIGINT(20) NULL, `index` BIGINT(20) NULL, `head_repo_id` BIGINT(20) NULL, `base_repo_id` BIGINT(20) NULL,  NULL, `head_branch` VARCHAR(255) NULL, `base_branch` VARCHAR(255) NULL, `merge_base` VARCHAR(40) NULL, `has_merged` TINYINT(1) NULL, `merged_commit_id` VARCHAR(40) NULL, `merger_id` BIGINT(20) NULL, `merged_unix` BIGINT(20) NULL, `conflicted_files` TEXT NULL) [] - 23.187µs
2020/12/10 12:20:33 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] ROLLBACK [] - 18.148µs
2020/12/10 12:20:33 routers/init.go:88:initDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: migrate: do migrate: near "NULL": syntax error
2020/12/10 12:20:33 routers/init.go:89:initDBEngine() [I] Backing off for 3 seconds

Could you try updating the version to be 103 (this’ll skip the 102 migration entirely, the 102 migration drops a column in the database, however a limitation of sqlite is that you can’t drop columns, you’d need to recreate the table, so by skipping this migration the column will continue to exist. In later versions of Gitea than yours there is a doctor command that’ll allow you to recreate tables via CLI if you are inclined to do so)

To do so, do what you did previously to connect to your database, and then run UPDATE version SET version = 103 and then restart gitea on with the newer version.

OK, so I updated the version. (BTW, what did that do in practice, except just changing a single value in the database?). Then upgraded gitea to :latest -> not showing in browser. Tried 1.13 -> not showing in browser. Tried 1.12 and then 1.11 -> same outcome.

Then I tried 1.10, and it worked! At least I was able to go past the 1.9.x version. Then I tried 1.11 -> worked! Then 1.12 -> worked too! Then 1.13 -> not showing in browser, although now the logs are a bit different:

Docker log:

2020-12-11 15:41:32,stdout,e[36m2020/12/11 15:41:32 e[0me[32mrouters/init.go:133:e[32mGlobalInit()e[0m e[1;36m[T]e[0m Log path: e[1m/data/gitea/loge[0m
2020-12-11 15:41:32,stdout,e[36m2020/12/11 15:41:32 e[0me[32mrouters/init.go:132:e[32mGlobalInit()e[0m e[1;36m[T]e[0m Custom path: e[1m/data/giteae[0m
2020-12-11 15:41:32,stdout,e[36m2020/12/11 15:41:32 e[0me[32mrouters/init.go:131:e[32mGlobalInit()e[0m e[1;36m[T]e[0m AppWorkPath: e[1m/app/giteae[0m
2020-12-11 15:41:32,stdout,e[36m2020/12/11 15:41:32 e[0me[32mrouters/init.go:130:e[32mGlobalInit()e[0m e[1;36m[T]e[0m AppPath: e[1m/app/gitea/giteae[0m
2020-12-11 15:41:32,stdout,"e[36m2020/12/11 15:41:32 e[0me[32m...dules/setting/git.go:91:e[32mnewGit()e[0m e[1;32m[I]e[0m Git Version: e[1m2.26.2e[0m, Wire Protocol e[1mVersion 2e[0m Enabled "
2020-12-11 15:41:32,stdout,e[36m2020/12/11 15:41:32 e[0me[32mcmd/web.go:108:e[32mrunWeb()e[0m e[1;32m[I]e[0m Starting Gitea on PID: e[1m15e[0m
2020-12-11 15:41:31,stdout,Server listening on 0.0.0.0 port 22.
2020-12-11 15:41:31,stdout,Server listening on :: port 22.
2020-12-11 15:41:31,stdout,Could not load host certificate "/data/ssh/ssh_host_dsa_cert": No such file or directory
2020-12-11 15:41:31,stdout,Could not load host certificate "/data/ssh/ssh_host_ecdsa_cert": No such file or directory
2020-12-11 15:41:31,stdout,Could not load host certificate "/data/ssh/ssh_host_rsa_cert": No such file or directory
2020-12-11 15:41:31,stdout,Could not load host certificate "/data/ssh/ssh_host_ed25519_cert": No such file or directory
2020-12-11 15:41:31,stdout,Received signal 15; terminating.

That is, in fact, correct - I do not have the “…_cert” files in my /data/ssh/ - only the “…_key” and “…_key.pub” files. Looks like these worked up to 1.12.x, but not in 1.13, right? Can I somehow convert the _key and _key.pub into _cert?

gitea.log on the other hand is filled with these:

2020/12/11 15:47:49 routers/init.go:82:initDBEngine() [I] ORM engine initialization attempt #9/10...
2020/12/11 15:47:49 ...rm/session_schema.go:25:Ping() [I] PING DATABASE sqlite3
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' and name = ? [version] - 54.861µs
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT * FROM version LIMIT 0 [] - 21.615µs
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT * FROM version LIMIT 0 [] - 22.274µs
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 [1] - 22.973µs
2020/12/11 15:47:49 ...ations/migrations.go:336:Migrate() [I] Migration[151]: set default password algorithm to Argon2
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' [] - 24.3µs
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [user] - 33.786µs
...
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [repo_topic] - 27.188µs
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] BEGIN TRANSACTION [] - 31.828µs
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] CREATE TABLE IF NOT EXISTS `tmp_recreate__user` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NULL, `lower_name` VARCHAR(255) NULL, `NOT` NULL NULL, `name` VARCHAR(255) NULL, `NOT` NULL NULL, `full_name` VARCHAR(255) NULL, `NULL`  NULL, `email` VARCHAR(255) NULL, `NOT` NULL NULL, `keep_email_private` TINYINT(1) NULL, `NULL`  NULL, `passwd` VARCHAR(255) NULL, `NOT` NULL NULL, `login_type` INTEGER NULL, `login_source` BIGINT(20) NULL, `DEFAULT` '' NOT NULL, `login_name` VARCHAR(255) NULL, `NULL`  NULL, `type` INTEGER NULL, `location` VARCHAR(255) NULL, `NULL`  NULL, `website` VARCHAR(255) NULL, `NULL`  NULL, `rands` VARCHAR(10) NULL, `NULL`  NULL, `salt` VARCHAR(10) NULL, `NULL`  NULL, `language` VARCHAR(5) NULL, `NULL`  NULL, `created_unix` BIGINT(20) NULL, `NULL`  NULL, `updated_unix` BIGINT(20) NULL, `NULL`  NULL, `last_login_unix` BIGINT(20) NULL, `NULL`  NULL, `last_repo_visibility` TINYINT(1) NULL, `NULL`  NULL, `max_repo_creation` INTEGER DEFAULT -1 NOT NULL, `is_active` TINYINT(1) NULL, `NULL`  NULL, `is_admin` TINYINT(1) NULL, `NULL`  NULL, `allow_git_hook` TINYINT(1) NULL, `NULL`  NULL, `allow_import_local` TINYINT(1) NULL, `NULL`  NULL, `allow_create_organization` TINYINT(1) NULL, `DEFAULT` '' NOT NULL, `prohibit_login` TINYINT(1) NULL, `DEFAULT` '' NOT NULL, `avatar` VARCHAR(2048) NULL, `NOT` NULL NULL, `avatar_email` VARCHAR(255) NULL, `NOT` NULL NULL, `use_custom_avatar` TINYINT(1) NULL, `NULL`  NULL, `num_followers` INTEGER NULL, `num_following` INTEGER DEFAULT 0 NOT NULL, `num_stars` INTEGER NULL, `num_repos` INTEGER NULL, `description` VARCHAR(255) NULL, `NULL`  NULL, `num_teams` INTEGER NULL, `num_members` INTEGER NULL, `diff_view_style` VARCHAR(255) NULL, `DEFAULT` '' NOT NULL, `must_change_password` INTEGER DEFAULT 0 NOT NULL, `theme` TEXT DEFAULT '' NOT NULL, `visibility` INTEGER DEFAULT 0 NOT NULL, `passwd_hash_algo` TEXT DEFAULT 'argon2' NOT NULL, `email_notifications_preference` TEXT DEFAULT 'enabled' NOT NULL, `repo_admin_change_team_access` INTEGER DEFAULT 0 NOT NULL, `is_restricted` INTEGER DEFAULT 0 NOT NULL, `keep_activity_private` INTEGER NULL) [] - 27.879µs
2020/12/11 15:47:49 ...s/migrations/v151.go:101:setDefaultPasswordToArgon2() [E] Unable to create table tmp_recreate__user. Error: duplicate column name: NOT
	%!(EXTRA *log.ColoredValue=[CREATE TABLE IF NOT EXISTS `tmp_recreate__user` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NULL, `lower_name` VARCHAR(255) NULL, `NOT` NULL NULL, `name` VARCHAR(255) NULL, `NOT` NULL NULL, `full_name` VARCHAR(255) NULL, `NULL`  NULL, `email` VARCHAR(255) NULL, `NOT` NULL NULL, `keep_email_private` TINYINT(1) NULL, `NULL`  NULL, `passwd` VARCHAR(255) NULL, `NOT` NULL NULL, `login_type` INTEGER NULL, `login_source` BIGINT(20) NULL, `DEFAULT` '' NOT NULL, `login_name` VARCHAR(255) NULL, `NULL`  NULL, `type` INTEGER NULL, `location` VARCHAR(255) NULL, `NULL`  NULL, `website` VARCHAR(255) NULL, `NULL`  NULL, `rands` VARCHAR(10) NULL, `NULL`  NULL, `salt` VARCHAR(10) NULL, `NULL`  NULL, `language` VARCHAR(5) NULL, `NULL`  NULL, `created_unix` BIGINT(20) NULL, `NULL`  NULL, `updated_unix` BIGINT(20) NULL, `NULL`  NULL, `last_login_unix` BIGINT(20) NULL, `NULL`  NULL, `last_repo_visibility` TINYINT(1) NULL, `NULL`  NULL, `max_repo_creation` INTEGER DEFAULT -1 NOT NULL, `is_active` TINYINT(1) NULL, `NULL`  NULL, `is_admin` TINYINT(1) NULL, `NULL`  NULL, `allow_git_hook` TINYINT(1) NULL, `NULL`  NULL, `allow_import_local` TINYINT(1) NULL, `NULL`  NULL, `allow_create_organization` TINYINT(1) NULL, `DEFAULT` '' NOT NULL, `prohibit_login` TINYINT(1) NULL, `DEFAULT` '' NOT NULL, `avatar` VARCHAR(2048) NULL, `NOT` NULL NULL, `avatar_email` VARCHAR(255) NULL, `NOT` NULL NULL, `use_custom_avatar` TINYINT(1) NULL, `NULL`  NULL, `num_followers` INTEGER NULL, `num_following` INTEGER DEFAULT 0 NOT NULL, `num_stars` INTEGER NULL, `num_repos` INTEGER NULL, `description` VARCHAR(255) NULL, `NULL`  NULL, `num_teams` INTEGER NULL, `num_members` INTEGER NULL, `diff_view_style` VARCHAR(255) NULL, `DEFAULT` '' NOT NULL, `must_change_password` INTEGER DEFAULT 0 NOT NULL, `theme` TEXT DEFAULT '' NOT NULL, `visibility` INTEGER DEFAULT 0 NOT NULL, `passwd_hash_algo` TEXT DEFAULT 'argon2' NOT NULL, `email_notifications_preference` TEXT DEFAULT 'enabled' NOT NULL, `repo_admin_change_team_access` INTEGER DEFAULT 0 NOT NULL, `is_restricted` INTEGER DEFAULT 0 NOT NULL, `keep_activity_private` INTEGER NULL)])
2020/12/11 15:47:49 ...m.io/xorm/core/db.go:286:afterProcess() [I] [SQL] ROLLBACK [] - 19.265µs
2020/12/11 15:47:49 routers/init.go:88:initDBEngine() [E] ORM engine initialization attempt #9/10 failed. Error: migrate: do migrate: duplicate column name: NOT
2020/12/11 15:47:49 routers/init.go:89:initDBEngine() [I] Backing off for 3 seconds

I removed ~100 or so of the “[I] [SQL] SELECT …” statements to save space.

Anyway, in the end it seems it is now 1.12 -> 1.13 upgrade issue.

It skipped that migration, as it was a “drop column” migration and that column doesn’t have any required value (can be left empty) it didn’t harm your system to skip.

An exit code 15 means that linux is sending SIGTERM to Gitea, likely the out-of-memory controller. This is unusual as I would suspect it to happen with the 1.12 migration as it is prone to using most memory due to it having to index language of each repository, whereas you are getting it for 1.13.

Could not load host certificate

These warnings can be ignored, they are if you are using a certificate authority to manage your opensshd server (which is fairly uncommon)

Unable to create table tmp_recreate__user

This is essentially the same error you were getting for 1.10 upgrade except now it is is setting a new default value for a specific column, sadly sqlite can’t change default values of tables but rather they need to be fully re-created. This is another migration that can be skipped somewhat safely.

Like last time are you able to provide the value of your version table? I suspect it will be 151. If it is, then are you able to do as before and update it to 152 and then upgrade Gitea to 1.13?

We’ve tested these migrations on sqlite prior to releasing them, so I’m wondering where our tests have failed, are you able to provide the output of sqlite3 --version?

Thank you techknowlogick!

My db version under gitea 1.12.6 was 141. I updated it to 152 and was able to start gitea 1.13.0.

Thanks again!

1 Like