Skip to content
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

Migration failure #21761

Closed
berkus opened this issue Nov 10, 2022 · 3 comments · Fixed by #21764
Closed

Migration failure #21761

berkus opened this issue Nov 10, 2022 · 3 comments · Fixed by #21764
Labels
issue/workaround it is or has a workaround type/bug

Comments

@berkus
Copy link

berkus commented Nov 10, 2022

Description

The migration from previous gitea version fails with a panic.

panic: cannot create context from nil parent

goroutine 1 [running]:
context.WithDeadline({0x0?, 0x0?}, {0x5a46a80?, 0x53d1ac1000?, 0x5a46a80?})
	/usr/local/go/src/context/context.go:436 +0x41b
context.WithTimeout({0x0, 0x0}, 0xc0000f6f80?)
	/usr/local/go/src/context/context.go:507 +0x4a
code.gitea.io/gitea/modules/process.(*Manager).AddContextTimeout(0x1?, {0x0?, 0x0?}, 0x6?, {0xc002751130, 0x4f})
	/source/modules/process/manager.go:114 +0x52
code.gitea.io/gitea/modules/git.(*Command).Run(0xc0005009a0, 0x1c?)
	/source/modules/git/command.go:208 +0x405
code.gitea.io/gitea/modules/git.EnsureValidGitRepository({0x0?, 0x0}, {0xc00275a480, 0x34})
	/source/modules/git/batch_reader.go:37 +0x2e9
code.gitea.io/gitea/modules/git.OpenRepository({0x0?, 0x0}, {0xc00275a480?, 0x6?})
	/source/modules/git/repo_base_nogogit.go:53 +0x85
code.gitea.io/gitea/models/migrations.fixPublisherIDforTagReleases(0x2?)
	/source/models/migrations/v156.go:112 +0x76a
code.gitea.io/gitea/models/migrations.(*migration).Migrate(0x1?, 0x21?)
	/source/models/migrations/migrations.go:50 +0x22
code.gitea.io/gitea/models/migrations.Migrate(0xc002758280)
	/source/models/migrations/migrations.go:504 +0x778
code.gitea.io/gitea/models/db.InitEngineWithMigration({0x3e6e490?, 0xc0000c0000?}, 0x384be18)
	/source/models/db/engine.go:191 +0x5f
code.gitea.io/gitea/cmd.runMigrate(0xc0005b11e0?)
	/source/cmd/migrate.go:40 +0x2b6
github.com/urfave/cli.HandleAction({0x2630a20?, 0x384bc10?}, 0x7?)
	/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:524 +0xa8
github.com/urfave/cli.Command.Run({{0x2ac23a0, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x2be946c, 0x14}, {0x0, ...}, ...}, ...)
	/go/pkg/mod/github.com/urfave/cli@v1.22.9/command.go:173 +0x652
github.com/urfave/cli.(*App).Run(0xc0005cd180, {0xc000096040, 0x4, 0x4})
	/go/pkg/mod/github.com/urfave/cli@v1.22.9/app.go:277 +0x8a7
main.main()
	/source/main.go:116 +0xcf9

What could that be?

Upgrading from gitea 1.12.5 to 1.17.3.

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/berkus/cc4222fe714b95474cb25f8e9f7b11f9

Screenshots

No response

Git Version

No response

Operating System

Debian Bullseye

How are you running Gitea?

Downloaded from official site via

wget https://dl.gitea.io/gitea/1.17.3/gitea-1.17.3-linux-amd64

Database

PostgreSQL

@berkus
Copy link
Author

berkus commented Nov 10, 2022

gitea doctor:

[1] Check paths and basic configuration
 - [I] Configuration File Path:    "/etc/gitea/app.ini"
 - [I] Repository Root Path:       "/var/lib/gitea/repositories"
 - [I] Data Root Path:             "/var/lib/gitea/data"
 - [I] Custom File Root Path:      "/var/lib/gitea/custom"
 - [I] Work directory:             "/var/lib/gitea"
 - [I] Log Root Path:              "/var/lib/gitea/log"
OK
[2] Check Database Version
 - [C] Error: migrate: Current database version 156 is not equal to the expected version 224. 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
 - [C] Unable to regenerate authorized_keys file. ERROR: pq: column "verified" does not exist
ERROR

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 10, 2022

It's a bug caused by the git module & database migration dependency.

@wxiaoguang wxiaoguang added the issue/workaround it is or has a workaround label Nov 10, 2022
zeripath pushed a commit that referenced this issue Nov 10, 2022
Close #21761

Some database migrations depend on the git module.
@berkus
Copy link
Author

berkus commented Nov 10, 2022

🙇🏼

fsologureng pushed a commit to fsologureng/gitea that referenced this issue Nov 11, 2022
Close go-gitea#21761

Some database migrations depend on the git module.
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/workaround it is or has a workaround type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants