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

DeleteIssue API fails with 500 on pull requests #20921

Closed
earl-warren opened this issue Aug 23, 2022 · 0 comments · Fixed by #21720
Closed

DeleteIssue API fails with 500 on pull requests #20921

earl-warren opened this issue Aug 23, 2022 · 0 comments · Fixed by #21720
Labels
Milestone

Comments

@earl-warren
Copy link
Contributor

earl-warren commented Aug 23, 2022

Description

Calling https://try.gitea.io/api/swagger#/issue/issueDelete on a pull request fails with the following error on v1.18.0+dev-317-g36dfe544f

The pull request is however successfully deleted.

2022/08/23 06:25:33 [630472dd-81] router: failed    DELETE /api/v1/repos/user5577006791947779410/projectname/issues/1 for 172.17.0.1:58026, panic in 20.9ms @ repo/issue.go:846(repo.DeleteIssue), err=runtime error: invalid memory address or nil pointer dereference
2022/08/23 06:25:33 ...common/middleware.go:71:1() [E] [630472dd-81] PANIC: runtime error: invalid memory address or nil pointer dereference
	/usr/local/go/src/runtime/panic.go:260 (0x459595)
	/usr/local/go/src/runtime/signal_unix.go:835 (0x459565)
	/go/src/code.gitea.io/gitea/modules/git/repo_commit_nogogit.go:59 (0xe4ad59)
	/go/src/code.gitea.io/gitea/services/issue/issue.go:152 (0x1be1758)
	/go/src/code.gitea.io/gitea/routers/api/v1/repo/issue.go:884 (0x2131fb3)
	/go/src/code.gitea.io/gitea/modules/web/wrap_convert.go:63 (0x1fa9913)
	/go/src/code.gitea.io/gitea/modules/web/wrap.go:41 (0x1fa7fe4)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:442 (0x1bb5355)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/src/code.gitea.io/gitea/modules/web/wrap.go:98 (0x1fa8a6c)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/src/code.gitea.io/gitea/modules/web/wrap.go:98 (0x1fa8a6c)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/src/code.gitea.io/gitea/modules/context/api.go:277 (0x1bbcb51)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/src/code.gitea.io/gitea/routers/api/v1/api.go:1190 (0x2180493)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:71 (0x1bb3114)
	/go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:314 (0x1bb4b1b)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:442 (0x1bb5355)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/src/code.gitea.io/gitea/routers/common/middleware.go:79 (0x2068562)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/src/code.gitea.io/gitea/modules/web/routing/logger_manager.go:123 (0x1fa3cf3)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/middleware/strip.go:30 (0x2065df8)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/pkg/mod/github.com/chi-middleware/proxy@v1.1.1/middleware.go:37 (0x2062816)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/src/code.gitea.io/gitea/routers/common/middleware.go:32 (0x20683b1)
	/usr/local/go/src/net/http/server.go:2109 (0x94c30e)
	/go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:88 (0x1bb30cf)
	/go/src/code.gitea.io/gitea/modules/web/route.go:200 (0x1fa740d)
	/usr/local/go/src/net/http/server.go:2947 (0x94f70b)
	/usr/local/go/src/net/http/server.go:1991 (0x94ade6)
	/usr/local/go/src/runtime/asm_amd64.s:1594 (0x477280)

Gitea Version

v1.18.0+dev-317-g36dfe544f

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

a

Screenshots

a

Git Version

a

Operating System

a

How are you running Gitea?

a

Database

No response

@lunny lunny added this to the 1.17.4 milestone Oct 19, 2022
lunny added a commit that referenced this issue Nov 12, 2022
Fix #20921.

The `ctx.Repo.GitRepo` has been used in deleting issues when the issue
is a PR.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
jolheiser pushed a commit that referenced this issue Nov 13, 2022
Backport #21720.

Fix #20921.

The `ctx.Repo.GitRepo` has been used in deleting issues when the issue
is a PR.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
techknowlogick pushed a commit that referenced this issue Nov 13, 2022
Backport #21720.

Fix #20921.

The `ctx.Repo.GitRepo` has been used in deleting issues when the issue
is a PR.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants