NPE in routers/web/feed/profile.go:37 on 1.16.7 following failed migration #8921

Closed
opened 2025-11-02 08:23:10 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @zeripath on GitHub (May 6, 2022).

Extract from a comment in #19613

2022/05/05 20:06:26 ...s/graceful/server.go:61:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 16
2022/05/05 20:06:46 Started GET / for 10.###.###.###:0
2022/05/05 20:06:46 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/routers/web/feed/profile.go:37 (0x1fbb59c)
/go/src/code.gitea.io/gitea/routers/web/user/home.go:134 (0x1fd20d2)
/go/src/code.gitea.io/gitea/routers/web/home.go:41 (0x2034770)
/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)
...

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.

Originally posted by @number42net in https://github.com/go-gitea/gitea/issues/19613#issuecomment-1119134431

Originally created by @zeripath on GitHub (May 6, 2022). Extract from a comment in #19613 ``` 2022/05/05 20:06:26 ...s/graceful/server.go:61:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 16 2022/05/05 20:06:46 Started GET / for 10.###.###.###:0 2022/05/05 20:06:46 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/routers/web/feed/profile.go:37 (0x1fbb59c) /go/src/code.gitea.io/gitea/routers/web/user/home.go:134 (0x1fd20d2) /go/src/code.gitea.io/gitea/routers/web/home.go:41 (0x2034770) /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) ... ``` 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. _Originally posted by @number42net in https://github.com/go-gitea/gitea/issues/19613#issuecomment-1119134431_
GiteaMirror added the type/bug label 2025-11-02 08:23:10 -06:00
Author
Owner

@zeripath commented on GitHub (May 6, 2022):

The line in 1.16 is:

46637b1164/routers/web/feed/profile.go (L37)

And implies that act.Repo is nil which would imply that it was not being set in here:

46637b1164/models/action_list.go (L63-L81)

Likely because the repository does not exist.

Now, this code has changed a lot on main, so whilst there's a clear fix in 1.16 I'm not sure if 1.17 is affected.

@zeripath commented on GitHub (May 6, 2022): The line in 1.16 is: https://github.com/go-gitea/gitea/blob/46637b1164a2da6fed013d1acc151c79c192da83/routers/web/feed/profile.go#L37 And implies that `act.Repo` is `nil` which would imply that it was not being set in here: https://github.com/go-gitea/gitea/blob/46637b1164a2da6fed013d1acc151c79c192da83/models/action_list.go#L63-L81 Likely because the repository does not exist. Now, this code has changed a lot on main, so whilst there's a clear fix in 1.16 I'm not sure if 1.17 is affected.
Author
Owner

@zeripath commented on GitHub (May 6, 2022):

and in fact it appears that this is very likely related to #19598

@zeripath commented on GitHub (May 6, 2022): and in fact it appears that this is very likely related to #19598
Author
Owner

@number42net commented on GitHub (May 6, 2022):

@zeripath Thanks for opening this and for looking into it!

@number42net commented on GitHub (May 6, 2022): @zeripath Thanks for opening this and for looking into it!
Author
Owner

@Gusted commented on GitHub (May 11, 2022):

PR's are merged, but for some reason Github didn't think about closing the linked issue.

@Gusted commented on GitHub (May 11, 2022): PR's are merged, but for some reason Github didn't think about closing the linked issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8921