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

[v1.14.2] segfault, gitea/models/migrations.fixPublisherIDforTagReleases #15827

Closed
2 of 6 tasks
davidlt opened this issue May 11, 2021 · 1 comment · Fixed by #15835
Closed
2 of 6 tasks

[v1.14.2] segfault, gitea/models/migrations.fixPublisherIDforTagReleases #15827

davidlt opened this issue May 11, 2021 · 1 comment · Fixed by #15835
Milestone

Comments

@davidlt
Copy link

davidlt commented May 11, 2021

  • Gitea version (or commit ref): v1.14.2 (updated from v1.13.7)
  • Git version: 2.25.4
  • Operating system: Fedora 31
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
[..]
systemd[1]: Started Gitea (Git with a cup of tea).
gitea[1200992]: 2021/05/10 23:47:11 cmd/web.go:82:runWeb() [I] Starting Gitea on PID: 1200992
gitea[1200992]: 2021/05/10 23:47:11 ...dules/setting/git.go:101:newGit() [I] Git Version: 2.25.4, Wire Protocol Version 2 Enabled
gitea[1200992]: 2021/05/10 23:47:11 cmd/web.go:126:runWeb() [I] Global init
gitea[1200992]: 2021/05/10 23:47:11 ...dules/setting/git.go:101:newGit() [I] Git Version: 2.25.4, Wire Protocol Version 2 Enabled
gitea[1200992]: 2021/05/10 23:47:11 routers/init.go:134:GlobalInit() [T] AppPath: 
gitea[1200992]: 2021/05/10 23:47:11 routers/init.go:135:GlobalInit() [T] AppWorkPath: 
gitea[1200992]: 2021/05/10 23:47:11 routers/init.go:136:GlobalInit() [T] Custom path: 
gitea[1200992]: 2021/05/10 23:47:11 routers/init.go:137:GlobalInit() [T] Log path: 
gitea[1200992]: 2021/05/10 23:47:11 routers/init.go:49:checkRunMode() [I] Run Mode: Prod
gitea[1200992]: panic: runtime error: invalid memory address or nil pointer dereference
gitea[1200992]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1bbe0ca]
gitea[1200992]: goroutine 1 [running]:
gitea[1200992]: code.gitea.io/gitea/models/migrations.fixPublisherIDforTagReleases(0xc00148cbd0, 0x0, 0x0)
gitea[1200992]:         /source/models/migrations/v156.go:129 +0x7ca
gitea[1200992]: code.gitea.io/gitea/models/migrations.(*migration).Migrate(0xc002802f30, 0xc00148cbd0, 0x2b7b8df, 0x11)
gitea[1200992]:         /source/models/migrations/migrations.go:49 +0x34
gitea[1200992]: code.gitea.io/gitea/models/migrations.Migrate(0xc00148cbd0, 0x0, 0x0)
gitea[1200992]:         /source/models/migrations/migrations.go:397 +0x538
gitea[1200992]: code.gitea.io/gitea/models.NewEngine(0x409f0c8, 0xc00054a180, 0x38c50c0, 0x2b, 0xc00137bce0)
gitea[1200992]:         /source/models/models.go:220 +0x9b
gitea[1200992]: code.gitea.io/gitea/routers.initDBEngine(0x409f0c8, 0xc00054a180, 0x2b7ccba, 0x11)
gitea[1200992]:         /source/routers/init.go:76 +0x1fc
gitea[1200992]: code.gitea.io/gitea/routers.GlobalInit(0x409f0c8, 0xc00054a180)
gitea[1200992]:         /source/routers/init.go:154 +0x376
gitea[1200992]: code.gitea.io/gitea/cmd.runWeb(0xc00042c000, 0x0, 0x0)
gitea[1200992]:         /source/cmd/web.go:128 +0x478
gitea[1200992]: github.com/urfave/cli.HandleAction(0x265aa20, 0x38c5030, 0xc00042c000, 0xc00042c000, 0x0)
gitea[1200992]:         /source/vendor/github.com/urfave/cli/app.go:524 +0x105
gitea[1200992]: github.com/urfave/cli.Command.Run(0x2a64fa0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2bc8ce0, 0x16, 0x0, ...)
gitea[1200992]:         /source/vendor/github.com/urfave/cli/command.go:173 +0x579
gitea[1200992]: github.com/urfave/cli.(*App).Run(0xc00044e380, 0xc00003c080, 0x4, 0x4, 0x0, 0x0)
gitea[1200992]:         /source/vendor/github.com/urfave/cli/app.go:277 +0x808
gitea[1200992]: main.main()
gitea[1200992]:         /source/main.go:115 +0xa6a
systemd[1]: gitea.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
systemd[1]: gitea.service: Failed with result 'exit-code'.
systemd[1]: gitea.service: Consumed 3min 42.361s CPU time.
systemd[1]: gitea.service: Scheduled restart job, restart counter is at 42.
systemd[1]: Stopped Gitea (Git with a cup of tea).
systemd[1]: gitea.service: Consumed 3min 42.361s CPU time.
systemd[1]: Started Gitea (Git with a cup of tea).
gitea[1265465]: 2021/05/10 23:49:52 cmd/web.go:82:runWeb() [I] Starting Gitea on PID: 1265465
gitea[1265465]: 2021/05/10 23:49:52 ...dules/setting/git.go:101:newGit() [I] Git Version: 2.25.4, Wire Protocol Version 2 Enabled
gitea[1265465]: 2021/05/10 23:49:52 cmd/web.go:126:runWeb() [I] Global init
gitea[1265465]: 2021/05/10 23:49:52 ...dules/setting/git.go:101:newGit() [I] Git Version: 2.25.4, Wire Protocol Version 2 Enabled
[..]

Description

I also cannot connected to web UI (I get connection refused). I assume because gitea is running some tasks in the background on all repos (which segfaults at some point) before being available.

Screenshots

@zeripath
Copy link
Contributor

The NPE is occurring here:

if user == nil || !strings.EqualFold(user.Email, commit.Author.Email) {

Either commit or commit.Author are nil.

but commit can't be nil due to the structure of the getCommit so it must be that commit.Author is nil which is really only possible if the tag surprisingly doesn't have a tagger field...

Are you able to compile some patches into gitea? I'll pop up a PR to try to avoid this problem by fixing the tag commit function to check if the tagger is not set to just use the commit author and so on.

@zeripath zeripath added this to the 1.14.3 milestone May 12, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants