Skip to content

Gitea fails to start after #13439 reverted db migration #13440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf opened this issue Nov 6, 2020 · 7 comments
Closed
4 tasks done

Comments

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

  • Gitea version (or commit ref): Gitea Version: 1.14.0+dev-157-g35cc82abbf and Gitea Version: 1.14.0+dev-158-gc178a36438
  • Git version: git version 2.29.2.299.gdc1121823c
  • Operating system: Arch Linux
  • Build from
    • source
  • Run with
    • systemd
  • Database:
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • No
  • Log gist:
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 cmd/web.go:115:runWeb() [I] Starting Gitea on PID: 282849
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...s/setting/setting.go:832:NewContext() [I] Default UI Location is Europe/Vienna
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...dules/setting/git.go:94:newGit() [I] Git Version: 2.29.2.299.gdc1121823c, Wire Protocol Version 2 Enabled
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 cmd/web.go:160:runWeb() [I] Global init
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...s/setting/setting.go:832:NewContext() [I] Default UI Location is Europe/Vienna
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...dules/setting/git.go:94:newGit() [I] Git Version: 2.29.2.299.gdc1121823c, Wire Protocol Version 2 Enabled
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 routers/init.go:164:GlobalInit() [T] AppPath: /usr/bin/gitea
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 routers/init.go:165:GlobalInit() [T] AppWorkPath: /var/lib/gitea
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 routers/init.go:166:GlobalInit() [T] Custom path: /var/lib/gitea/custom
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 routers/init.go:167:GlobalInit() [T] Log path: /var/log/gitea/
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...dules/setting/log.go:297:newLogService() [I] Gitea v1.14.0+dev-158-gc178a3643 built with GNU Make 4.3, go1.15.3 : bindata, sqlite, sqlite_unlock_notify
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...dules/setting/log.go:343:newLogService() [I] Gitea Log Mode: Console(Console:info)
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...dules/setting/log.go:249:generateNamedLogger() [I] Macaron Log: Console(console:info)
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:info)
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...dules/setting/log.go:249:generateNamedLogger() [I] Xorm Log: Console(console:info)
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...es/setting/mailer.go:131:newNotifyMailService() [I] Notify Mail Service Enabled
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...s/storage/storage.go:151:initAttachments() [I] Initialising Attachment storage with type: local
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...les/storage/local.go:44:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/attachments
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...s/storage/storage.go:145:initAvatars() [I] Initialising Avatar storage with type: local
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...les/storage/local.go:44:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/avatars
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...s/storage/storage.go:163:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...les/storage/local.go:44:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/repo-avatars
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...s/storage/storage.go:157:initLFS() [I] Initialising LFS storage with type: local
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...les/storage/local.go:44:NewLocalStorage() [I] Creating new Local Storage at /var/lib/gitea/data/lfs
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 routers/init.go:72:initDBEngine() [I] Beginning ORM engine initialization.
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 routers/init.go:79:initDBEngine() [I] ORM engine initialization attempt #1/15...
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...rm/session_schema.go:25:Ping() [I] PING DATABASE sqlite3
Nov 06 09:04:30 nebula gitea[282849]: Downgrading database version from '159' to '158' is not supported and may result in loss of data integrity.
Nov 06 09:04:30 nebula gitea[282849]: If you really know what you're doing, execute `UPDATE version SET version=158 WHERE id=1;`
Nov 06 09:04:30 nebula gitea[282849]: 2020/11/06 09:04:30 ...ations/migrations.go:334:Migrate() [F] Downgrading database version from '159' to '158' is not supported and may result in loss of data integrity.
Nov 06 09:04:30 nebula gitea[282849]:         If you really know what you're doing, execute `UPDATE version SET version=158 WHERE id=1;`
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/models/migrations/migrations.go:334 (0x16efa71)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/models/models.go:218 (0x1563e7d)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/routers/init.go:80 (0x204105b)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/routers/init.go:177 (0x2042051)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/cmd/web.go:162 (0x22988e8)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/vendor/github.com/urfave/cli/app.go:526 (0x16cfb5c)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/vendor/github.com/urfave/cli/command.go:174 (0x16d092d)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/vendor/github.com/urfave/cli/app.go:279 (0x16cda47)
Nov 06 09:04:30 nebula gitea[282849]:         /root/gitea-src/main.go:110 (0x22d92e9)
Nov 06 09:04:30 nebula gitea[282849]:         /usr/lib/go/src/runtime/proc.go:204 (0x442aa8)
Nov 06 09:04:30 nebula gitea[282849]:                 main: fn()
Nov 06 09:04:30 nebula gitea[282849]:         /usr/lib/go/src/runtime/asm_amd64.s:1374 (0x478c20)
Nov 06 09:04:30 nebula gitea[282849]:                 goexit: BYTE        $0x90        // NOP
Nov 06 09:04:30 nebula gitea[282849]:
Nov 06 09:04:30 nebula systemd[1]: gitea.service: Main process exited, code=exited, status=1/FAILURE

Description

Moving from pre-#13439 to after #13439 fails to migrate the db and Gitea does not start.
The revert in the PR causes Gitea to say this

Downgrading database version from '159' to '158' is not supported and may result in loss of data integrity.

Had to rollback to a commit prior to the subject PR being merged.

@lunny
Copy link
Member

lunny commented Nov 6, 2020

Please update the version on the database manually.

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor Author

Please update the version on the database manually.

  • upgraded to Gitea Version: 1.14.0+dev-158-gc178a36438
  • ran the update (or downgrade) manually with UPDATE version SET version=158 WHERE id=1;

Gitea now runs fine again 🚀
cheers.

@mdoerfel
Copy link

mdoerfel commented Nov 6, 2020

I can confirm the manual downgrade.

We are running gitea now for long time and appreciate it. Can you recommend a migration path from gitea:latest docker container to the stable release?

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor Author

I can confirm the manual downgrade.

We are running gitea now for long time and appreciate it. Can you recommend a migration path from gitea:latest docker container to the stable release?

as :latest is tracking master pretty much, wouldn't that be 1.14.whatever once it's out?

@mdoerfel
Copy link

mdoerfel commented Nov 6, 2020

as :latest is tracking master pretty much, wouldn't that be 1.14.whatever once it's out?

...unless you are using watchtower or some other means to track images updates.

You are right, stopping this behavior and waiting for the release to reach or exceed todays :latest version is probably the first migration step.

@lunny
Copy link
Member

lunny commented Nov 6, 2020

We are sorry if you have lost columns "commit_sha", "patch" of comments which type = 21 because of #13217 , if not, that's lucky.

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor Author

We are sorry if you have lost columns "commit_sha", "patch" of comments which type = 21 because of #13217 , if not, that's lucky.

I am not aware of that, and there's always backups to restore from if yes.
How could I verify it exactly?

@go-gitea go-gitea locked and limited conversation to collaborators Dec 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants