-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Edit issue API returns 500 #32030
Comments
Thanks for the report, are you able to share an example of the contents of the PATCH payload? |
I think, i found the problem. It's here: gitea/routers/api/v1/repo/issue.go Line 836 in f05d9c9
Some additional check is required here. I'm making request with |
Here is sample payload to reproduce issue: |
Or may be it should return 412 error (bad request) in this case? So can understand that i'm doing something wrong ;) |
I think a 400 error should be returned if the |
Backport #32035 by @Zettat123 Fix #32030 Co-authored-by: Zettat123 <[email protected]>
Description
When using API endpoint:
PATCH /repos/{owner}/{repo}/issues/{index}
server returns 500 (internal server error):PANIC: runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:785 (0x477751)
/source/modules/web/routing/logger_manager.go:116 (0x1e85ba8)
/usr/local/go/src/runtime/panic.go:785 (0x477751)
/usr/local/go/src/runtime/panic.go:262 (0x479bd8)
/usr/local/go/src/runtime/signal_unix.go:900 (0x479ba8)
/source/routers/api/v1/repo/issue.go:836 (0x29dbd9a)
/usr/local/go/src/reflect/value.go:581 (0x504ea5)
/usr/local/go/src/reflect/value.go:365 (0x503fb8)
/source/modules/web/handler.go:172 (0x1e8f63c)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/chain.go:31 (0x1e86485)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:459 (0x1e89421)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:182 (0x1e8f6db)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/services/context/api.go:238 (0x2a599bd)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:136 (0x1e8fad9)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/routers/api/v1/api.go:1615 (0x2a59556)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:136 (0x1e8fad9)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:73 (0x1e8702e)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:327 (0x1e889ba)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:459 (0x1e89421)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/routing/logger_manager.go:122 (0x1e85a38)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:136 (0x1e8fad9)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/go/pkg/mod/github.com/chi-middleware/[email protected]/middleware.go:37 (0x29b2a93)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:136 (0x1e8fad9)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/routers/common/middleware.go:59 (0x29b3c6f)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:136 (0x1e8fad9)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/routers/common/middleware.go:50 (0x29b37fb)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:136 (0x1e8fad9)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/routers/common/middleware.go:36 (0x29b3429)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/source/modules/web/handler.go:136 (0x1e8fad9)
/usr/local/go/src/net/http/server.go:2220 (0x96c328)
/go/pkg/mod/github.com/go-chi/chi/[email protected]/mux.go:90 (0x1e86fed)
/source/modules/web/route.go:225 (0x1e9133b)
/source/modules/web/route.go:165 (0x1e90e64)
/usr/local/go/src/net/http/server.go:3210 (0x98c88d)
/usr/local/go/src/net/http/server.go:2092 (0x96accf)
/usr/local/go/src/runtime/asm_amd64.s:1700 (0x480160)
Gitea Version
1.22.2
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
2.30.2
Operating System
Debian
How are you running Gitea?
Was tested on demo.gitea.com, latest release and latest nightly build. Error is everywhere.
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: