-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[bug] uters/routes/base.go:153:1() [E] PANIC: runtime error: invalid memory address or nil pointer dereference #15558
Comments
The panic is coming from: Line 1465 in 990c608
Implying that the That comes from L362: Lines 357 to 363 in 990c608
Which implies that the problem is in Are you using the go-git variant or plain git variant? |
tbh, I am not sure. I installed gitea as binary from the official repository. How would I notice the difference? |
No problem so this is a bug in the native git backend then. Would it be possible to try the following patch? From 88f39bfc3f9e139450cbfc1b88f054efe5c26362 Mon Sep 17 00:00:00 2001
From: Andrew Thornton <[email protected]>
Date: Tue, 20 Apr 2021 21:12:30 +0100
Subject: [PATCH] Fix NPE on view commit with notes
Fix #15558
Signed-off-by: Andrew Thornton <[email protected]>
---
modules/git/notes_nogogit.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/git/notes_nogogit.go b/modules/git/notes_nogogit.go
index 613efd2e0..1379e5085 100644
--- a/modules/git/notes_nogogit.go
+++ b/modules/git/notes_nogogit.go
@@ -8,6 +8,7 @@ package git
import (
"io/ioutil"
+ "strings"
)
// GetNote retrieves the git-notes data for a given commit.
@@ -49,7 +50,13 @@ func GetNote(repo *Repository, commitID string, note *Note) error {
}
note.Message = d
- lastCommits, err := GetLastCommitForPaths(notes, "", []string{path})
+ treePath := ""
+ if idx := strings.LastIndex(path, "/"); idx > -1 {
+ treePath = path[:idx]
+ path = path[idx+1:]
+ }
+
+ lastCommits, err := GetLastCommitForPaths(notes, treePath, []string{path})
if err != nil {
return err
}
--
2.25.1
|
Do I have to build gitea for source to try out the patch? |
yes - but I can build a v1.14.x version for you if you tell me which architecture you need |
That would be nice. It's Debian buster x64 |
temporary build is up at https://eldritchkitty.com/~andrew/gitea-v1.14.x-15558-linux-amd64.gz
is a signature for the gz file. gunzip it once you've got it. |
I will try the build tomorrow and keep you updated. Thanks |
Fix go-gitea#15558 Signed-off-by: Andrew Thornton <[email protected]>
fix confirmed, thanks for the quick help |
keep it open until it got merged :) |
Fix #15558 Signed-off-by: Andrew Thornton <[email protected]>
Backport go-gitea#15561 Fix go-gitea#15558 Signed-off-by: Andrew Thornton <[email protected]>
Backport #15561 Fix #15558 Signed-off-by: Andrew Thornton <[email protected]>
Fix go-gitea#15558 Signed-off-by: Andrew Thornton <[email protected]>
debian buster
[x]
):2021/04/20 18:15:28 ...uters/routes/base.go:153:1() [E] PANIC: runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:212 (0x43de1a)
/usr/local/go/src/runtime/signal_unix.go:734 (0x457b72)
/source/models/user.go:1465 (0x1506c66)
/source/routers/repo/commit.go:362 (0x2084bb5)
/source/modules/web/route.go:53 (0x1f7de6b)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/github.com/go-chi/chi/mux.go:436 (0x1b3720a)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/modules/web/route.go:92 (0x1f7e3d6)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/modules/web/route.go:92 (0x1f7e3d6)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/modules/web/route.go:92 (0x1f7e3d6)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/github.com/go-chi/chi/middleware/get_head.go:37 (0x21ad921)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/modules/context/context.go:704 (0x1b563a1)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/routers/routes/base.go:94 (0x21b4d21)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/routers/routes/base.go:94 (0x21b4d21)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/modules/public/public.go:86 (0x13f4947)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/modules/public/public.go:86 (0x13f4947)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/routers/routes/base.go:199 (0x21b6910)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/gitea.com/go-chi/session/session.go:256 (0x154682e)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/github.com/go-chi/chi/mux.go:70 (0x1b34d6a)
/source/vendor/github.com/go-chi/chi/mux.go:311 (0x1b3b15b)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/github.com/go-chi/chi/mux.go:436 (0x1b3720a)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/routers/routes/web.go:110 (0x21b7d5d)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/routers/routes/base.go:38 (0x21b399b)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/github.com/go-chi/chi/middleware/strip.go:30 (0x21ae227)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/github.com/chi-middleware/proxy/middleware.go:37 (0x21a988e)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/routers/routes/web.go:66 (0x21b789c)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/source/vendor/github.com/go-chi/chi/mux.go:87 (0x1b34af0)
/source/modules/web/route.go:268 (0x1f7d3b3)
/source/vendor/github.com/gorilla/context/context.go:141 (0x11b4b53)
/usr/local/go/src/net/http/server.go:2069 (0x7bd0c3)
/usr/local/go/src/net/http/server.go:2887 (0x7c0682)
/usr/local/go/src/net/http/server.go:1952 (0x7bbbac)
/usr/local/go/src/runtime/asm_amd64.s:1371 (0x47a4e0)
Description
getting a 500 error when opening a commit of a fairly large repo
git gc, git fsck all done, no issues detected
The text was updated successfully, but these errors were encountered: