Skip to content

Migration failure #21761

Closed
Closed
@berkus

Description

@berkus

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

Activity

berkus

berkus commented on Nov 10, 2022

@berkus
Author

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

wxiaoguang commented on Nov 10, 2022

@wxiaoguang
Contributor

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

added a commit that references this issue on Nov 10, 2022
92525dd
berkus

berkus commented on Nov 10, 2022

@berkus
Author

🙇🏼

added a commit that references this issue on Nov 11, 2022
bd3e99b
locked and limited conversation to collaborators on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @berkus@wxiaoguang

      Issue actions

        Migration failure · Issue #21761 · go-gitea/gitea