HimbeerserverDE / mt-multiserver-proxy

mt-multiserver-proxy is a reverse proxy designed for linking multiple Minetest servers together
MIT License
27 stars 6 forks source link

Proxy Crash When Connecting to Minetest Server #149

Closed Neocraft1293 closed 2 days ago

Neocraft1293 commented 1 week ago

Description: I am experiencing a crash with the proxy when trying to connect to my Minetest server. I am using a Docker image for both the proxy and the server. Both the server and client are running version 5.9.0.

Logs:

2024/10/07 23:37:11 load config
2024/10/07 23:37:11 [proxy] version: v0.0.0-20240823094619-53d8cfd7d042
2024/10/07 23:37:11 [proxy] load plugins
2024/10/07 23:37:11 [proxy] listen [::]:40000
2024/10/07 23:37:11 [10.89.0.27:34045] -> connect
2024/10/07 23:37:11 [proxy] 10.89.0.27:34045 is closed
2024/10/07 23:37:11 [10.89.0.27:34045] <-> disconnect
2024/10/07 23:37:15 [10.89.0.27:51152] -> connect
2024/10/07 23:37:15 [10.89.0.27:51152 test123154] -> set password
panic: interface conversion: *color.NRGBA is not mt.deserializer: missing method deserialize [recovered]
        panic: interface conversion: *color.NRGBA is not mt.deserializer: missing method deserialize [recovered]
        panic: interface conversion: *color.NRGBA is not mt.deserializer: missing method deserialize [recovered]
        panic: interface conversion: *color.NRGBA is not mt.deserializer: missing method deserialize [recovered]
        panic: interface conversion: *color.NRGBA is not mt.deserializer: missing method deserialize

goroutine 76 [running]:
github.com/HimbeerserverDE/mt.pcall.func1()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:45 +0x76
panic({0xbbfa80?, 0xc00007f950?})
        /usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/HimbeerserverDE/mt.pcall.func1()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:45 +0x76
panic({0xbbfa80?, 0xc00007f950?})
        /usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/HimbeerserverDE/mt.pcall.func1()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:45 +0x76
panic({0xbbfa80?, 0xc00007f950?})
        /usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/HimbeerserverDE/mt.pcall.func1()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:45 +0x76
panic({0xbbfa80?, 0xc00007f950?})
        /usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/HimbeerserverDE/mt.(*WearBarParams).deserialize.deserialize.func2()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:31 +0x39
github.com/HimbeerserverDE/mt.pcall(0xd17240?)
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:48 +0x57
github.com/HimbeerserverDE/mt.deserialize(...)
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:31
github.com/HimbeerserverDE/mt.(*WearBarParams).deserialize(0xc000411018, {0xd17240, 0xc000160b10})
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/serialize.go:43325 +0x3be
github.com/HimbeerserverDE/mt.(*ItemDef).deserialize.func14()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/serialize.go:33098 +0x2a
github.com/HimbeerserverDE/mt.pcall(0xd17240?)
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:48 +0x57
github.com/HimbeerserverDE/mt.(*ItemDef).deserialize(0xc000410e60, {0x70269d0c5820?, 0xc0000a20a0})
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/serialize.go:33047 +0x1b87
github.com/HimbeerserverDE/mt.(*ToCltItemDefs).deserialize.func1()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/serialize.go:4089 +0x6f
github.com/HimbeerserverDE/mt.pcall(0x70269d0c5820?)
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:48 +0x57
github.com/HimbeerserverDE/mt.(*ToCltItemDefs).deserialize(0xc00007f050, {0xd171c0?, 0xc000160048})
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/serialize.go:4085 +0x2fc
github.com/HimbeerserverDE/mt.Peer.Recv.deserialize.func1()
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:31 +0x51
github.com/HimbeerserverDE/mt.pcall(0xbe88e0?)
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:48 +0x57
github.com/HimbeerserverDE/mt.deserialize(...)
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/zerialize.go:31
github.com/HimbeerserverDE/mt.Peer.Recv({0xc0001472e0?})
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt@v0.0.0-20240823094226-df181fce5c15/proto.go:77 +0x2b1
github.com/HimbeerserverDE/mt-multiserver-proxy.handleContent(0xc000196000)
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt-multiserver-proxy@v0.0.0-20240823094619-53d8cfd7d042/content.go:144 +0xfc
created by github.com/HimbeerserverDE/mt-multiserver-proxy.connectContent in goroutine 72
        /go/pkg/mod/github.com/!himbeerserver!d!e/mt-multiserver-proxy@v0.0.0-20240823094619-53d8cfd7d042/connect.go:62 +0x25a
HimbeerserverDE commented 1 week ago

This looks like a bug in my fork of the protocol/serialization library. Which subgame and mods are you using on the server? Knowing them might help with reproducing the issue.

I'll try to debug this before the end of this week but I can't make any guarantees about when I have time.

Neocraft1293 commented 1 week ago

I'm using the base game 'devtest' without any mods on the server.

HimbeerserverDE commented 1 week ago

Thanks for the information. I have managed to trigger the crash with devtest (without docker). "Minetest Game" and "VoxeLibre" work fine. I'm not sure how far I'm going to get with debugging today, it's most likely going to be a few more days before I can fix this.

HimbeerserverDE commented 1 week ago

The crash is caused by a faulty (de)serialization override for item definition wear bar parameters. I have now fixed this in the library but haven't updated the proxy to use it yet. There is another issue with node definitions that now causes all nodes to be unknown nodes on the client. While this is better than a crash it is still unusable and I am going to fix it before releasing a fixed version.

HimbeerserverDE commented 1 week ago

Node definitions are now fixed too, but I discovered yet another bug: devtest and MTG only showed a grey screen after switching servers because the fog distance was reset to the wrong default value (I missed this because Minetest only initializes some of the struct fields in the declaration and uses a method for the other fields). This has been fixed as well and everything seems to be working (though I don't have a docker environment to test with and can't easily make large downloads because I currently don't have internet service in my flat).

Please rebuild/pull the latest image and close the issue if it's fixed for you too.

Thanks for reporting this!