Hi !
last month a power outage turned off my private/personal server with gitea-1.15.10-linux-amd64 and when rebooted it doesn’t start anymore
to make things worse I tried to update the binary to the last 1.19.3 but no success yet
so i tried
sudo ./gitea-1.19.3-linux-amd64 doctor -c /usr/local/bin/custom/conf/app.ini web
and the result is
[1] Check paths and basic configuration
- [I] Configuration File Path: "/usr/local/bin/custom/conf/app.ini"
- [I] Repository Root Path: "/var/lib/gitea/repositories"
- [I] Data Root Path: "/home/xxx/data"
- [I] Custom File Root Path: "/home/xxx/custom"
- [I] Work directory: "/home/xxx"
- [I] Log Root Path: "/usr/local/bin/log"
OK
[2] Check Database Version
- [I] Expected database version: 244
**- [C] Error: migrate: Current database version 184 is not equal to the expected version 244. Please run "gitea [--config /path/to/app.ini] migrate" to update the database version during ensure up to date**
ERROR
[3] Check if user with wrong type exist
OK
[4] Check if OpenSSH authorized_keys file is up-to-date
OK
[5] Synchronize repo HEADs
- [C] Error when fixing repo HEADs: no such column: num_action_runs
- [I] All 0 repos have their HEADs in the correct state
ERROR
so i run migrate
sudo ./gitea-1.19.3-linux-amd64 -c /usr/local/bin/custom/conf/app.ini migrate
2023/07/06 16:10:33 ...s/setting/setting.go:327:loadRunModeFrom() [C] You are running Gitea using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.
2023/07/06 16:10:33 ...g/config_provider.go:30:deprecatedSetting() [E] Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be/has been removed in v1.19.0
2023/07/06 16:10:33 cmd/migrate.go:33:runMigrate() [I] AppPath: /home/xxx/gitea-1.19.3-linux-amd64
2023/07/06 16:10:33 cmd/migrate.go:34:runMigrate() [I] AppWorkPath: /home/xxx
2023/07/06 16:10:33 cmd/migrate.go:35:runMigrate() [I] Custom path: /home/xxx/custom
2023/07/06 16:10:33 cmd/migrate.go:36:runMigrate() [I] Log path: /usr/local/bin/log
2023/07/06 16:10:33 cmd/migrate.go:37:runMigrate() [I] Configuration file: /usr/local/bin/custom/conf/app.ini
2023/07/06 16:10:33 .../cli@v1.22.10/app.go:277:Run() [I] PING DATABASE sqlite3
2023/07/06 16:10:34 models/db/engine.go:190:InitEngineWithMigration() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' [] - 40.592µs
2023/07/06 16:10:34 ...ations/migrations.go:518:Migrate() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [version] - 33.843µs
2023/07/06 16:10:34 ...ations/migrations.go:518:Migrate() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [version] - 29.358µs
2023/07/06 16:10:34 ...bfc5ce9830/engine.go:1244:Get() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 [1] - 27.216µs
2023/07/06 16:10:34 ...ations/migrations.go:565:Migrate() [I] Migration[184]: Rename Task errors to message
2023/07/06 16:10:34 models/db/engine.go:190:InitEngineWithMigration() [I] [SQL] SELECT * FROM task LIMIT 0 [] - 53.175µs
2023/07/06 16:10:34 models/db/engine.go:190:InitEngineWithMigration() [I] [SQL] SELECT * FROM task LIMIT 0 [] - 28.069µs
2023/07/06 16:10:34 models/db/engine.go:190:InitEngineWithMigration() [I] [SQL] BEGIN TRANSACTION [] - 66.302µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' [] - 32.053µs
2023/07/06 16:10:34 ...ations/v1_15/v184.go:45:RenameTaskErrorsToMessage() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [task] - 217.168µs
2023/07/06 16:10:34 ...ations/v1_15/v184.go:45:RenameTaskErrorsToMessage() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [task] - 29.305µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP INDEX `IDX_task_doer_id` [] - 513.353µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP INDEX `IDX_task_owner_id` [] - 203.711µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP INDEX `IDX_task_repo_id` [] - 132.119µs
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column id but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column doer_id but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column owner_id but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column repo_id but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column start_time but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column end_time but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column payload_content but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column message but struct has not related field
2023/07/06 16:10:34 cmd/migrate.go:39:runMigrate() [W] Table task has column created but struct has not related field
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] PRAGMA index_list(`task`) [] - 36.503µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] PRAGMA index_info(`IDX_task_status`) [] - 15.194µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] SELECT sql FROM sqlite_master WHERE tbl_name='task' and type='table' [] - 31.194µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] CREATE TABLE `new_task_new` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `doer_id` INTEGER NULL, `owner_id` INTEGER NULL, `repo_id` INTEGER NULL, `type` INTEGER NULL, `status` INTEGER NULL, `start_time` INTEGER NULL, `end_time` INTEGER NULL, `payload_content` TEXT NULL, "message" TEXT NULL, `created` INTEGER NULL, `errors` TEXT NULL) [] - 235.807µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] INSERT INTO `new_task_new` (`id`,`doer_id`,`owner_id`,`repo_id`,`type`,`status`,`start_time`,`end_time`,`payload_content`,`created`,`errors`) SELECT `id`,`doer_id`,`owner_id`,`repo_id`,`type`,`status`,`start_time`,`end_time`,`payload_content`,`created`,`errors` FROM task [] - 113.62µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP TABLE `task` [] - 471.636µs
2023/07/06 16:10:34 ...ations/migrations.go:59:Migrate() [I] [SQL] ALTER TABLE `new_task_new` RENAME TO `task` [] - 9.37751ms
2023/07/06 16:10:34 ...ations/migrations.go:568:Migrate() [I] [SQL] ALTER TABLE `task` RENAME COLUMN errors TO message [] - 12.034603ms
2023/07/06 16:10:34 ...ations/migrations.go:568:Migrate() [I] [SQL] ROLLBACK [] - 242.668µs
2023/07/06 16:10:34 cmd/migrate.go:40:runMigrate() [F] Failed to initialize ORM engine: migrate: migration[184]: Rename Task errors to message failed: error in table task after rename: duplicate column name: message
root@nextdan:/home/xxx# sudo ./gitea-1.19.3-linux-amd64 doctor fix -c /usr/local/bin/custom/conf/app.ini web
[1] Check paths and basic configuration
root@nextdan:/home/xxx# sudo ./gitea-1.19.3-linux-amd64 -c /usr/local/bin/custom/conf/app.ini web
2023/07/06 16:12:25 cmd/web.go:105:runWeb() [I] Starting Gitea on PID: 22162
2023/07/06 16:12:25 ...s/setting/setting.go:327:loadRunModeFrom() [C] You are running Gitea using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.
2023/07/06 16:12:25 ...g/config_provider.go:30:deprecatedSetting() [E] Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be/has been removed in v1.19.0
2023/07/06 16:12:25 cmd/web.go:159:runWeb() [I] Global init
2023/07/06 16:12:25 ...s/setting/setting.go:327:loadRunModeFrom() [C] You are running Gitea using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.
2023/07/06 16:12:25 ...g/config_provider.go:30:deprecatedSetting() [E] Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be/has been removed in v1.19.0
2023/07/06 16:12:25 routers/init.go:118:GlobalInitInstalled() [I] Git Version: 2.17.1 (home: /home/xxx/data/home)
2023/07/06 16:12:25 routers/init.go:119:GlobalInitInstalled() [I] AppPath: /home/xxx/gitea-1.19.3-linux-amd64
2023/07/06 16:12:25 routers/init.go:120:GlobalInitInstalled() [I] AppWorkPath: /home/xxx
2023/07/06 16:12:25 routers/init.go:121:GlobalInitInstalled() [I] Custom path: /home/xxx/custom
2023/07/06 16:12:25 routers/init.go:122:GlobalInitInstalled() [I] Log path: /usr/local/bin/log
2023/07/06 16:12:25 routers/init.go:123:GlobalInitInstalled() [I] Configuration file: /usr/local/bin/custom/conf/app.ini
2023/07/06 16:12:25 routers/init.go:124:GlobalInitInstalled() [I] Run Mode: Prod
2023/07/06 16:12:25 routers/init.go:125:GlobalInitInstalled() [I] Gitea v1.19.3 built with GNU Make 4.1, go1.20.4 : bindata, sqlite, sqlite_unlock_notify
2023/07/06 16:12:26 ...dules/setting/log.go:331:initLogFrom() [I] Gitea Log Mode: File(File:debug)
2023/07/06 16:12:26 ...dules/setting/log.go:337:initLogFrom() [I] According to the configuration, subsequent logs will not be printed to the console
but it failed
the log at /usr/local/bin/log/gitea.log
2023/07/06 16:12:53 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #10/10...
2023/07/06 16:12:53 cmd/web.go:163:runWeb() [I] PING DATABASE sqlite3
2023/07/06 16:12:53 routers/common/db.go:44:migrateWithSetting() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' [] - 113.809µs
2023/07/06 16:12:53 ...ations/migrations.go:518:Migrate() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [version] - 119.74µs
2023/07/06 16:12:53 ...ations/migrations.go:518:Migrate() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [version] - 141.62µs
2023/07/06 16:12:53 ...bfc5ce9830/engine.go:1244:Get() [I] [SQL] SELECT `id`, `version` FROM `version` WHERE `id`=? LIMIT 1 [1] - 28.865µs
2023/07/06 16:12:53 ...ations/migrations.go:565:Migrate() [I] Migration[184]: Rename Task errors to message
2023/07/06 16:12:53 routers/common/db.go:44:migrateWithSetting() [I] [SQL] SELECT * FROM task LIMIT 0 [] - 30.679µs
2023/07/06 16:12:53 routers/common/db.go:44:migrateWithSetting() [I] [SQL] SELECT * FROM task LIMIT 0 [] - 24.821µs
2023/07/06 16:12:53 routers/common/db.go:44:migrateWithSetting() [I] [SQL] BEGIN TRANSACTION [] - 95.96µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] SELECT name FROM sqlite_master WHERE type='table' [] - 30.875µs
2023/07/06 16:12:53 ...ations/v1_15/v184.go:45:RenameTaskErrorsToMessage() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='table' and name = ? [task] - 211.094µs
2023/07/06 16:12:53 ...ations/v1_15/v184.go:45:RenameTaskErrorsToMessage() [I] [SQL] SELECT sql FROM sqlite_master WHERE type='index' and tbl_name = ? [task] - 32.983µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP INDEX `IDX_task_repo_id` [] - 390.596µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP INDEX `IDX_task_doer_id` [] - 195.523µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP INDEX `IDX_task_owner_id` [] - 165.16µs
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column id but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column doer_id but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column owner_id but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column repo_id but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column start_time but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column end_time but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column payload_content but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column message but struct has not related field
2023/07/06 16:12:53 models/db/engine.go:190:InitEngineWithMigration() [W] Table task has column created but struct has not related field
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] PRAGMA index_list(`task`) [] - 19.994µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] PRAGMA index_info(`IDX_task_status`) [] - 14.429µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] SELECT sql FROM sqlite_master WHERE tbl_name='task' and type='table' [] - 36.98µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] CREATE TABLE `new_task_new` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `doer_id` INTEGER NULL, `owner_id` INTEGER NULL, `repo_id` INTEGER NULL, `type` INTEGER NULL, `status` INTEGER NULL, `start_time` INTEGER NULL, `end_time` INTEGER NULL, `payload_content` TEXT NULL, "message" TEXT NULL, `created` INTEGER NULL, `errors` TEXT NULL) [] - 243.641µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] INSERT INTO `new_task_new` (`id`,`doer_id`,`owner_id`,`repo_id`,`type`,`status`,`start_time`,`end_time`,`payload_content`,`created`,`errors`) SELECT `id`,`doer_id`,`owner_id`,`repo_id`,`type`,`status`,`start_time`,`end_time`,`payload_content`,`created`,`errors` FROM task [] - 102.589µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] DROP TABLE `task` [] - 343.395µs
2023/07/06 16:12:53 ...ations/migrations.go:59:Migrate() [I] [SQL] ALTER TABLE `new_task_new` RENAME TO `task` [] - 8.571436ms
2023/07/06 16:12:53 ...ations/migrations.go:568:Migrate() [I] [SQL] ALTER TABLE `task` RENAME COLUMN errors TO message [] - 12.101774ms
2023/07/06 16:12:53 ...ations/migrations.go:568:Migrate() [I] [SQL] ROLLBACK [] - 243.146µs
**2023/07/06 16:12:53 routers/init.go:70:mustInitCtx() [F] code.gitea.io/gitea/routers/common.InitDBEngine(ctx) failed: migrate: migration[184]: Rename Task errors to message failed: error in table task after rename: duplicate column name: message**
the errors in bold are the same with both 1.15.10 and 1.19.3
Any suggestions ?