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

Internal Server Error on one Particular Commit Detail Page #16943

Closed
2 of 6 tasks
zaha opened this issue Sep 3, 2021 · 2 comments · Fixed by #16950
Closed
2 of 6 tasks

Internal Server Error on one Particular Commit Detail Page #16943

zaha opened this issue Sep 3, 2021 · 2 comments · Fixed by #16950
Labels
Milestone

Comments

@zaha
Copy link

zaha commented Sep 3, 2021

  • Gitea version (or commit ref): 1.15.1
  • Git version: 2.33.0.windows.2
  • Operating system: Windows Server 2019
    • Using precompiled gitea-1.15.1-windows-4.0-amd64.exe
    • Running it as a windows service with its own webservice
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
2021/09/03 13:04:29 routers/web/base.go:131:1() [E] PANIC: runtime error: index out of range [2] with length 0
	/usr/local/go/src/runtime/panic.go:88 (0xdca689)
	/source/services/gitdiff/gitdiff.go:1042 (0x2061c8f)
	/source/services/gitdiff/gitdiff.go:861 (0x205e7ed)
	/source/services/gitdiff/gitdiff.go:1263 (0x2062c6f)
	/source/services/gitdiff/gitdiff.go:1299 (0x2a82cc4)
	/source/routers/web/repo/commit.go:307 (0x2a82c5f)
	/source/modules/web/route.go:64 (0x2a2cf7b)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:436 (0x20c148a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/middleware/get_head.go:37 (0x2a50d21)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/context/context.go:776 (0x20e2729)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:70 (0x20bef8a)
	/source/vendor/github.com/go-chi/chi/mux.go:311 (0x20c543b)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:436 (0x20c148a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/web/base.go:186 (0x2c62a17)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/gitea.com/go-chi/session/session.go:256 (0x1ec36ce)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/public/public.go:42 (0x20346b0)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:70 (0x20bef8a)
	/source/vendor/github.com/go-chi/chi/mux.go:311 (0x20c543b)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:436 (0x20c148a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/common/middleware.go:72 (0x2a558a4)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/common/logger.go:23 (0x2a54ac8)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/middleware/strip.go:30 (0x2a51667)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/chi-middleware/proxy/middleware.go:37 (0x2a4cb93)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/common/middleware.go:25 (0x2a553e7)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:87 (0x20bed10)
	/source/modules/web/route.go:318 (0x2a2c49a)
	/source/vendor/github.com/gorilla/context/context.go:141 (0x1bcc01a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/usr/local/go/src/net/http/server.go:2867 (0x1168c29)
	/usr/local/go/src/net/http/server.go:1932 (0x11640ac)
	/usr/local/go/src/runtime/asm_amd64.s:1371 (0xe06540)
	
2021/09/03 13:04:29 ...common/middleware.go:64:1() [E] PANIC: interface conversion: interface {} is nil, not *context.APIContext
	/usr/local/go/src/runtime/iface.go:261 (0xd9ce97)
	/source/modules/context/api.go:135 (0x2c6295e)
	/source/routers/web/base.go:151 (0x2c61fe0)
	/usr/local/go/src/runtime/panic.go:965 (0xdcd026)
	/usr/local/go/src/runtime/panic.go:88 (0xdca689)
	/source/services/gitdiff/gitdiff.go:1042 (0x2061c8f)
	/source/services/gitdiff/gitdiff.go:861 (0x205e7ed)
	/source/services/gitdiff/gitdiff.go:1263 (0x2062c6f)
	/source/services/gitdiff/gitdiff.go:1299 (0x2a82cc4)
	/source/routers/web/repo/commit.go:307 (0x2a82c5f)
	/source/modules/web/route.go:64 (0x2a2cf7b)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:436 (0x20c148a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/middleware/get_head.go:37 (0x2a50d21)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/web/route.go:103 (0x2a2d669)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/context/context.go:776 (0x20e2729)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:70 (0x20bef8a)
	/source/vendor/github.com/go-chi/chi/mux.go:311 (0x20c543b)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:436 (0x20c148a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/web/base.go:186 (0x2c62a17)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/gitea.com/go-chi/session/session.go:256 (0x1ec36ce)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/modules/public/public.go:42 (0x20346b0)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:70 (0x20bef8a)
	/source/vendor/github.com/go-chi/chi/mux.go:311 (0x20c543b)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:436 (0x20c148a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/common/middleware.go:72 (0x2a558a4)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/common/logger.go:23 (0x2a54ac8)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/middleware/strip.go:30 (0x2a51667)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/chi-middleware/proxy/middleware.go:37 (0x2a4cb93)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/routers/common/middleware.go:25 (0x2a553e7)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/source/vendor/github.com/go-chi/chi/mux.go:87 (0x20bed10)
	/source/modules/web/route.go:318 (0x2a2c49a)
	/source/vendor/github.com/gorilla/context/context.go:141 (0x1bcc01a)
	/usr/local/go/src/net/http/server.go:2049 (0x11655ea)
	/usr/local/go/src/net/http/server.go:2867 (0x1168c29)
	/usr/local/go/src/net/http/server.go:1932 (0x11640ac)
	/usr/local/go/src/runtime/asm_amd64.s:1371 (0xe06540)
	

Description

When clicking on the latest commit in one of my repositories I get an internal server error and the error logs above. I was not able to reproduce this on any other commit in the same or a different repository (tried a dozen).

Clicking on (1) in the screenshot leads to the error:
image
While clicking on (2) works as expected (see second screenshot).

The commit in question contains only git lfs binary files, but that is true for commit 2 as well. Very strange.
Let me know if you need more information.

Screenshots

image
image

@zeripath
Copy link
Contributor

zeripath commented Sep 3, 2021

would it be possible to stick a .diff on the end of the commit url and send that to me on discord?

@zaha
Copy link
Author

zaha commented Sep 3, 2021

@zeripath Sure thing!

zeripath added a commit to zeripath/gitea that referenced this issue Sep 3, 2021
The lastLeftIdx should be reset at the same time as creating a new section otherwise
it is possible for a second addition to end up attempting to read a nil entry.

Fix go-gitea#16943

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit to zeripath/gitea that referenced this issue Sep 3, 2021
Backport go-gitea#16950

The lastLeftIdx should be reset at the same time as creating a new section otherwise
it is possible for a second addition to end up attempting to read a nil entry.

Fix go-gitea#16943

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added this to the 1.15.3 milestone Sep 3, 2021
6543 pushed a commit that referenced this issue Sep 5, 2021
The lastLeftIdx should be reset at the same time as creating a new section otherwise
it is possible for a second addition to end up attempting to read a nil entry.

Fix #16943

Signed-off-by: Andrew Thornton <art27@cantab.net>
6543 pushed a commit that referenced this issue Sep 5, 2021
Backport #16950

The lastLeftIdx should be reset at the same time as creating a new section otherwise
it is possible for a second addition to end up attempting to read a nil entry.

Fix #16943

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
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