gogs: Broken pull requests merge action after cherry picking
Gogs version
0.12.3 and 0.12.7
Git version
- Server: 2.36.1
- Client: -
Operating system
FreeBSD 12.2-stable
Database
PostgreSQL 11.16
Describe the bug
Clicking on the “Merge” button on a PR crashes gogs, needing a full restart of the service to get it up again.
To reproduce
I’ve a repo with this structure:
- master
- dev
- feature/implement-whatever
- fix/incorrect-handling-whatever
- etc
- release/1.0.0
- release/1.1.0
- release/1.1.1
- etc
- dev
The workflow is, working on dev until we get to a point where we can make a release, create a branch release/1.1.1 (for example) and then merge that into master (using gogs, through a PR). Release branches are kept in the repo, but the feature/fix/etc branches are deleted after merged into dev.
So far so good, worked pretty well.
Now, with dev running 1.2.0 we needed to “backport” some fixes made in the dev branch, into a branch release/1.1.2 (bugfix for 1.1.x) without pulling all the work done in dev for the next release.
We created release/1.1.2 (from release/1.1.1) and then used cherry-pick to backport those fixes from dev. We did double check the branch locally, no conflicts, all ok and we pushed it to the main repo.
After that, we kept working normally and on the next merge of a fix/feature branch into dev, through gogs PR interface, gogs blows up and stops working (restart is needed).
In the log files we can see this message:
[Macaron] PANIC: Value not found for type *repo.HTTPContext
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/context.go:123 (0x1b62934)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/context.go:112 (0x1b75a65)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/recovery.go:161 (0x1b75a58)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/logger.go:40 (0x1b66377)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/github.com/go-macaron/inject/inject.go:157 (0x1b2fa54)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/github.com/go-macaron/inject/inject.go:135 (0x1b2f7f9)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/context.go:121 (0x1b627bc)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/router.go:187 (0x1b76cb0)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/router.go:303 (0x1b6ede5)
/wrkdirs/usr/ports/devel/gogs/work/gogs-0.12.3/vendor/gopkg.in/macaron.v1/macaron.go:220 (0x1b676ed)
/usr/local/go/src/net/http/server.go:2843 (0x1aca622)
/usr/local/go/src/net/http/server.go:1925 (0x1ac5e2c)
/usr/local/go/src/runtime/asm_amd64.s:1374 (0x1774060)
(that’s the first appearance of the error in our log files)
We did upgrade to 0.12.7, gogs still crashes, this is the output in the logs:
[Macaron] PANIC: Value not found for type *repo.HTTPContext
gopkg.in/macaron.v1@v1.3.9/context.go:123 (0x1a016bd)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x1a07346)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x1a0733d)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x1a048e4)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x19d8714)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x19d863c)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x1a015d2)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x1a0d1c4)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x1a0e32c)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x1a06464)
net/http/server.go:2916 (0x198141a)
net/http/server.go:1966 (0x197c8d6)
runtime/asm_amd64.s:1571 (0x1671f80)
Expected behavior
I’d expect to get PRs merged when I click on the “Merge” button in a PR page
Additional context
No response
Code of Conduct
- I agree to follow this project’s Code of Conduct
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (8 by maintainers)
Built gogs from sources (main branch) and tried again, this time the PR merge did not crash.
Thanks a lot @unknwon for fixing this.
Ok, built gogs from sources (branch jc/http-panic), go 1.18.2, git 2.36.1, then started it instead of our previous version.
Then I created a new branch in our repo, from dev, called test/new-gogs-fix, and modified a README file. I pushed those changes to the new branch, then in gogs I created a new PR to merge test/new-gogs-fix into dev, all good. Then I clicked merge and got a 502 gateway timeout, gogs crashed.
This is what I see in the logs now:
Hope it helps 😅