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

[bug] panic when browsing to URL of a public reply #3674

Open
LittleFox94 opened this issue Jan 23, 2025 · 2 comments
Open

[bug] panic when browsing to URL of a public reply #3674

LittleFox94 opened this issue Jan 23, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@LittleFox94
Copy link
Contributor

Describe the bug with a clear and concise description of what the bug is.

Hi,

I told about this in chat before and was asked to raise a bug - with a comment of it might already have been fixed, it seems to ring a bell :)

We had a thread going on that started with public visibility and every reply to it was then unlisted visibility. The start of that thread and several posts in the reply-chain were from a user from another instance. At some point I posted a reply, specifying public visibility and hoping to have a shareable URL of some pictures - but browsing the post URL only gives a white page in chromium/a failed download attempt in firefox; GoToSocial ran into a panic - logs below.

The post in question is this: https://gotosocial-dev.svc.0x0a.network/@littlefox/statuses/01JJ454BRPWJA4M2ECQND40E4Q

timestamp="21/01/2025 15:50:10.138" func=server.init.func1.Logger.13.1 level=INFO latency="602.637µs" userAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" method=GET statusCode=200 path=/@littlefox/statuses/01JJ454BRPWJA4M2ECQND40E4Q clientIP=202.61.208.66 errors="Error #01: recovered panic: runtime error: invalid memory address or nil pointer dereference\n" requestID=c970a76a4ec5b69139a246c0a84aba0a msg="OK: wrote 23B"
timestamp="21/01/2025 15:50:10.138" func=server.init.func1.Logger.13.1 level=ERROR stacktrace="()\n\t/usr/local/go/src/runtime/panic.go:261\nruntime.sigpanic()\n\t/usr/local/go/src/runtime/signal_unix.go:881\nweb.(*Module).threadGETHandler()\n\t/drone/src/internal/web/thread.go:111\n()\n\t/drone/src/vendor/github.com/gin-gonic/gin/context.go:185\ngzip.(*gzipHandler).Handle()\n\t/drone/src/vendor/github.com/gin-contrib/gzip/handler.go:60\ngin.(*Context).Next()\n\t/drone/src/vendor/github.com/gin-gonic/gin/context.go:185\nserver.init.func1.Logger.13()\n\t/drone/src/internal/middleware/logger.go:133\n()\n\t/drone/src/vendor/github.com/gin-gonic/gin/context.go:185\notelginmetrics.Middleware.func1()\n\t/drone/src/vendor/github.com/technologize/otel-go-contrib/otelginmetrics/middleware.go:68\n" requestID=c970a76a4ec5b69139a246c0a84aba0a msg="recovered panic: runtime error: invalid memory address or nil pointer dereference"

What's your GoToSocial Version?

0.17.2

GoToSocial Arch

amd64 docker-ish (Kubernetes, cri-o)

What happened?

Pointing a Browser at the URL of the post in question only gave an empty page, GoToSocial logged a panic.

What you expected to happen?

Seeing my post.

Since it was a reply to an unlisted post, I did not expect to see anything above it in the thread - basically just the post itself, just as if it wasn't a reply (or maybe a hint "Reply to a non-public post").

How to reproduce it?

  • post something with public visibility -> post A
  • reply to post A with unlisted visibility -> post B
  • reply to post B with public visibility -> post C
  • open browser to URL of post C

All those posts can be on the same instance, by the same user.

Anything else we need to know?

You are doing a great job and I can't wait for the next release 💙

@LittleFox94 LittleFox94 added the bug Something isn't working label Jan 23, 2025
@LittleFox94
Copy link
Contributor Author

I took the stack trace apart for some better readability, but I'm afraid it's not looking too helpful:

()
	/usr/local/go/src/runtime/panic.go:261
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:881
web.(*Module).threadGETHandler()
	/drone/src/internal/web/thread.go:111
()
	/drone/src/vendor/github.com/gin-gonic/gin/context.go:185
gzip.(*gzipHandler).Handle()
	/drone/src/vendor/github.com/gin-contrib/gzip/handler.go:60
gin.(*Context).Next()
	/drone/src/vendor/github.com/gin-gonic/gin/context.go:185
server.init.func1.Logger.13()
	/drone/src/internal/middleware/logger.go:133
()
	/drone/src/vendor/github.com/gin-gonic/gin/context.go:185
otelginmetrics.Middleware.func1()
	/drone/src/vendor/github.com/technologize/otel-go-contrib/otelginmetrics/middleware.go:68

@LittleFox94
Copy link
Contributor Author

Maybe-related issues are #3465 and #3341

#3465 defined "not serving public replies to non-public posts" as expected behavior, but that would make me sad - maybe reconsider together with what I wrote above in "What you expected to happen?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant