yukimochi / Activity-Relay

Yet another powerful customizable ActivityPub relay server written in Go.
https://relay.toot.yukimochi.jp/
GNU Affero General Public License v3.0
278 stars 39 forks source link

Panics since upgrading to 2.0.0 #79

Closed mhamzahkhan closed 1 year ago

mhamzahkhan commented 1 year ago

Hello!

I'm seeing a lot of panics since upgrading to 2.0.0. I don't know how to debug it. Is this a bug? or something wrong with my setup?

2023/03/27 13:25:01 http: panic serving 10.233.73.235:60464: interface conversion: interface {} is string, not map[string]interface {}
goroutine 1514315 [running]:
net/http.(*conn).serve.func1()
    /usr/local/go/src/net/http/server.go:1854 +0xbf
panic({0xb26200, 0xc000976a20})
    /usr/local/go/src/runtime/panic.go:890 +0x263
github.com/yukimochi/Activity-Relay/models.(*Activity).UnwrapInnerActivity(0xc000000c00?)
    /Activity-Relay/models/models.go:149 +0x39c
github.com/yukimochi/Activity-Relay/api.executeRelayActivity(0xc0008e3f80, 0xc000000c00, {0xc000949880, 0x307, 0x380})
    /Activity-Relay/api/resolver.go:334 +0x197
github.com/yukimochi/Activity-Relay/api.handleInbox({0xcbfa10, 0xc0008f6fc0}, 0x0?, 0x1?)
    /Activity-Relay/api/handle.go:111 +0x1f0
github.com/yukimochi/Activity-Relay/api.handlersRegister.func1({0xcbfa10?, 0xc0008f6fc0?}, 0xffffffffffffffff?)
    /Activity-Relay/api/api.go:78 +0x2a
net/http.HandlerFunc.ServeHTTP(0xc0008f6fc0?, {0xcbfa10?, 0xc0008f6fc0?}, 0xbdc09d?)
    /usr/local/go/src/net/http/server.go:2122 +0x2f
net/http.(*ServeMux).ServeHTTP(0x0?, {0xcbfa10, 0xc0008f6fc0}, 0xc00019ec00)
    /usr/local/go/src/net/http/server.go:2500 +0x149
net/http.serverHandler.ServeHTTP({0xcbe028?}, {0xcbfa10, 0xc0008f6fc0}, 0xc00019ec00)
    /usr/local/go/src/net/http/server.go:2936 +0x316
net/http.(*conn).serve(0xc0007b63f0, {0xcbfd88, 0xc00033e2d0})
    /usr/local/go/src/net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
    /usr/local/go/src/net/http/server.go:3089 +0x5ed
yukimochi commented 1 year ago

Thank you for your report!

An activity with an unexpected scheme was received. I'll check this. (I predict Update type or Delete type 🤔 )

yukimochi commented 1 year ago

@mhamzahkhan I released v2.0.1. More safer Activity interpretation implemented. Please try it. https://github.com/yukimochi/Activity-Relay/releases/tag/v2.0.1