-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Gitea 1.16.6: PANIC: runtime error: invalid memory address or nil pointer dereference #19613
Comments
I'm running into this issue as well, is there any workaround? This bug is presenting a 500 error on the Gitea users landing page. |
Please could you give the link for the reproducer on try.gitea.io |
CheckRepoUnitUser should tolerate nil users. Fix go-gitea#19613 Signed-off-by: Andrew Thornton <art27@cantab.net>
I'm sorry I don't have time to reproduce on a "demo" instance. The bug is quite clear, you have a full traceback. I even gave you a point in time where the regression occurred. At this point I can probably easily rollback to 1.16.5 |
@prologic I've tried rolling back myself, but I'm still getting the same issue. @zeripath I encountered it while running a migration, I tried cloning the last repo I worked on before getting the error. Initially I got an 500 error on the repo page, but that's gone after refreshing, so not sure how helpful this will be. You can find it at: https://try.gitea.io/testing_account/uvt-1224 |
Your report said you were able to reproduce it on try. That's why I phrased my comment the way I did. Although the panic is very helpful and I think I know how to fix it from that - it's always best to give us a concise reproducer or method for reproducing the problem. My guess from the panic and the logs is that you are looking at a compare page when you're not logged in? If so then my proposed PR will fix this. If not whilst the PR will prevent that panic there's likely another bug. |
I am suspicious that this is not the same bug if it was during a migration. We'd need to see your logs to see if it's the same. |
Here is a copy of the log:
The migration consists of pushing cloned repo's from GitHub into Gitea, the repo's are created using the API and data transferred using Git https. Now that I have migrated a few more repo's, the 500 error on the landing page is gone. Presumably because whatever was causing it is not longer shown on it. |
Oh I'm sorry! That was a mistake on my part 😅 I guess that option needs a "N/A" really. Sorry about that! There is no real repdocuer here anyway, as it seems it's web crawlers that are triggering this on my instance. In other words, there is nothing specific I or any of my users that use my instance are doing to trigger the bug. |
Also many thanks for fixing this so quickly! 🙏 I've just been "ignoring" the alert/alarms firing for the moment (as it's not causing any other significant impact) |
CheckRepoUnitUser should tolerate nil users. Fix #19613 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Reopen to wait for backport |
Backport go-gitea#19625 CheckRepoUnitUser should tolerate nil users. Fix go-gitea#19613 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@number42net that stacktrace indicates this is a completely different bug so I will open another issue for that. |
Nice work! 🥳🙇♀️ |
CheckRepoUnitUser should tolerate nil users. Fix go-gitea#19613 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Description
Crash in one of the handlers (regression in 1.16.6):
Gitea Version
1.16.7
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
2022/05/05 02:45:40 Started GET /marado/yarn/compare/master...new_ui?style=unified&whitespace=ignore-all for 216.244.66.235:0 2022/05/05 02:45:40 routers/web/base.go:130:1() [E] PANIC: runtime error: invalid memory address or nil pointer dereference /usr/local/go/src/runtime/panic.go:220 (0x457635) /usr/local/go/src/runtime/signal_unix.go:818 (0x457605) /go/src/code.gitea.io/gitea/models/repo.go:135 (0x138cf96) /go/src/code.gitea.io/gitea/models/repo.go:131 (0x1ea7944) /go/src/code.gitea.io/gitea/routers/web/repo/compare.go:448 (0x1ea791a) /go/src/code.gitea.io/gitea/routers/web/repo/compare.go:683 (0x1ea9c69) /go/src/code.gitea.io/gitea/modules/web/route.go:74 (0x1e47d44) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:442 (0x1656dd5) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/modules/web/route.go:113 (0x1e48531) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/modules/web/route.go:113 (0x1e48531) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/modules/web/route.go:113 (0x1e48531) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/middleware/get_head.go:37 (0x1e77de4) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/modules/web/route.go:113 (0x1e48531) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/modules/context/context.go:745 (0x1668786) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:71 (0x1654c0c) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:314 (0x16565bb) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:442 (0x1656dd5) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/routers/web/base.go:169 (0x20332d1) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/gitea.com/go-chi/session@v0.0.0-20211218221615-e3605d8b28b8/session.go:257 (0x146137d) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/modules/public/public.go:42 (0x15949db) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:71 (0x1654c0c) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:314 (0x16565bb) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:442 (0x1656dd5) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/routers/common/middleware.go:78 (0x1e7dfc1) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/routers/common/logger.go:23 (0x1e7d24f) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/middleware/strip.go:30 (0x1e7ab58) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/chi-middleware/proxy@v1.1.1/middleware.go:37 (0x1e77456) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/src/code.gitea.io/gitea/routers/common/middleware.go:31 (0x1e7de19) /usr/local/go/src/net/http/server.go:2084 (0x7ac6ce) /go/pkg/mod/github.com/go-chi/chi/v5@v5.0.7/mux.go:88 (0x1654bc1) /go/src/code.gitea.io/gitea/modules/web/route.go:328 (0x1e4b38d) /usr/local/go/src/net/http/server.go:2916 (0x7afcba) /usr/local/go/src/net/http/server.go:1966 (0x7ab176) /usr/local/go/src/runtime/asm_amd64.s:1571 (0x4745a0) 2022/05/05 02:45:40 Completed GET /marado/yarn/compare/master...new_ui?style=unified&whitespace=ignore-all 500 Internal Server Error in 43.252646ms
Screenshots
No response
Git Version
N/A
Operating System
N/A
How are you running Gitea?
Docker Swarm
Database
SQLite
The text was updated successfully, but these errors were encountered: