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

panic on git push --tags origin #13940

Closed
2 of 6 tasks
yukunyi opened this issue Dec 11, 2020 · 1 comment · Fixed by #13945
Closed
2 of 6 tasks

panic on git push --tags origin #13940

yukunyi opened this issue Dec 11, 2020 · 1 comment · Fixed by #13945
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change type/bug

Comments

@yukunyi
Copy link

yukunyi commented Dec 11, 2020

  • Gitea version (or commit ref): 1.14.0+dev-359-gc11cf4bb3
  • Git version: 2.26.2
  • Operating system: docker of debian
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

when do git push --tags origin
console output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x188e394]

goroutine 102 [running]:
code.gitea.io/gitea/modules/notification/action.(*actionNotifier).NotifyCreateRef(0x540fc78, 0x0, 0xc00000cb40, 0x29cab51, 0x3, 0xc008f26540, 0x1b)
	/go/src/code.gitea.io/gitea/modules/notification/action/action.go:317 +0x74
code.gitea.io/gitea/modules/notification.NotifyCreateRef(0x0, 0xc00000cb40, 0x29cab51, 0x3, 0xc008f26540, 0x1b)
	/go/src/code.gitea.io/gitea/modules/notification/notification.go:248 +0xae
code.gitea.io/gitea/services/repository.pushUpdates(0xc0079435e8, 0x1, 0x1, 0x0, 0x0)
	/go/src/code.gitea.io/gitea/services/repository/push.go:106 +0x7d6
code.gitea.io/gitea/services/repository.handle(0xc00255a000, 0x1, 0x14)
	/go/src/code.gitea.io/gitea/services/repository/push.go:32 +0x87
code.gitea.io/gitea/modules/queue.(*WorkerPool).doWork(0xc0011b8380, 0x3d06360, 0xc001324300)
	/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:383 +0x896
code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers.func1(0xc0011b8380, 0x3d06360, 0xc001324300)
	/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:238 +0x45
created by code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers
	/go/src/code.gitea.io/gitea/modules/queue/workerpool.go:237 +0x56
Received signal 15; terminating.

After the automatic restart, there is no related operation prompt in the UI list, nor in the tags list of the warehouse.

Screenshots

@zeripath
Copy link
Contributor

It looks like this is a result of #13381.


The panic occurs here:

ActUserID: doer.ID,

this implies that doer is nil... The function is called by:

notifier.NotifyCreateRef(pusher, repo, refType, refFullName)

and

https://github.com/go-gitea/gitea/blob/master/services/repository/push.go#L106

However as we can see here:

var pusher *models.User

pusher doesn't get set by anything for this call...

if pusher == nil || pusher.ID != opts.PusherID {
var err error
if pusher, err = models.GetUserByID(opts.PusherID); err != nil {
return err
}
}
needs to be copied to line100 .

@zeripath zeripath added issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Dec 11, 2020
zeripath added a commit to zeripath/gitea that referenced this issue Dec 11, 2020
PR go-gitea#13381 refactored notification actions to call NotifyCreateRef and
NotifyDeleteRef in a slightly different manner. This leads to the pusher
not being set before the call.

This PR ensures that the pusher is updated before the call.

Fix go-gitea#13940

Signed-off-by: Andrew Thornton <[email protected]>
6543 pushed a commit that referenced this issue Dec 11, 2020
PR #13381 refactored notification actions to call NotifyCreateRef and
NotifyDeleteRef in a slightly different manner. This leads to the pusher
not being set before the call.

This PR ensures that the pusher is updated before the call.

Fix #13940

Signed-off-by: Andrew Thornton <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented issue/regression Indicates a previously functioning feature or behavior that has broken or regressed after a change type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants