Closed cezarmathe closed 2 years ago
Thanks for you issue!
Tell me please what game causes this panic?
I see, it is Minecraft. I'll check
I get the same issue:
1.6526817170475295e+09 info stevebot2/main.go:55 hello, this is stevebot2
1.6526817170477707e+09 debug stevebot2/main.go:64 main config {"value": {"DiscordToken":"redacted","RconAddress":"redacted:25565","RconPassword":"redacted","Bot":{"CommandPrefix":"~"},"Steve":{"AllowedCommands":["help","seed","whitelist"]}}}
panic: runtime error: makeslice: len out of range
goroutine 1 [running]:
github.com/gorcon/rcon.(*Conn).auth(0xc000292000, {0xc00002604e?, 0xc00002a04d?})
/redacted/pkg/mod/github.com/gorcon/rcon@v1.3.2/rcon.go:206 +0x22a
github.com/gorcon/rcon.Dial({0xc00002a04d, 0x13}, {0xc00002604e, 0x28}, {0x0, 0x0, 0x1?})
/redacted/pkg/mod/github.com/gorcon/rcon@v1.3.2/rcon.go:112 +0x196
main.main()
/redacted/stevebot/cmd/stevebot2/main.go:72 +0x668
It could possibly be that the response size is 0 and it's a runtime error to make a slice of len 0.
On the side, though, I noticed that my server was not actually running. I haven't tested this with a running server yet, but I'll let you know how it goes - I'm quite confident it will work okay.
So this is more of an issue regarding what happens if the server is down. It's pretty weird, though, as I would've expected to get an error regarding the TCP connection and I noticed that there is error handling logic for that. The issue is on my end probably. I'll post an update when I test with a running server.
UPDATE 1: Same issue with the server running, but I get 2022/05/16 09:26:09 Failed to connect to RCON serverrcon: authentication failed
in my server logs.
UPDATE 2: I just noticed that I was using the game port instead of the rcon port. I fixed that and I no longer have this issue.
I added new error message instead this panic. Can you check this with wrong port on v1.3.3 please? I have no Minecraft server now and can reproduce it only on test mock.
{"error": "rcon: response from not rcon server"}
haha, yes, this is great!
My usage: https://github.com/cezarmathe/stevebot/blob/ac309b0f0555ec6f87572caf5f42b92180926789/cmd/stevebot2/main.go#L72
My logs:
I've identified that this issue comes from https://github.com/gorcon/rcon/blob/79dc2ba55137b18eff9cb2531b38afcc25a3989a/rcon.go#L202