Closed justinnobledev closed 1 year ago
Just to give a little bit of an update, the 1st one seems to be related to csgo and the 2nd one seems to be related to gmod.
Apparently CS:GO servers by default return only max players and server uptime from a note in the A2S documentation, which makes sense why its failing on parsing a name.
A server cvar can also change the format of the response, which is problematic since the client doesn't know which fields to parse.
Same issue with rust server, it's bizarre because it did work initially, then stopped after a while and threw up this ever since.
Serving metrics at http://127.0.0.1:9841/metrics
panic: runtime error: index out of range [3] with length 1
goroutine 6 [running]:
encoding/binary.littleEndian.Uint32(...)
/usr/local/go/src/encoding/binary/binary.go:80
github.com/rumblefrog/go-a2s.(*PacketReader).ReadUint32(...)
/go/pkg/mod/github.com/rumblefrog/go-a2s@v1.0.1/packet.go:89
github.com/rumblefrog/go-a2s.(*Client).parsePlayerInfo(0xc00017aa80, {0xc0001a0580?, 0x9?, 0x9?})
/go/pkg/mod/github.com/rumblefrog/go-a2s@v1.0.1/player.go:133 +0x4af
github.com/rumblefrog/go-a2s.(*Client).QueryPlayer(0x7ffc68301f73?)
/go/pkg/mod/github.com/rumblefrog/go-a2s@v1.0.1/player.go:95 +0x138
github.com/armsnyder/a2s-exporter/internal/collector.(*Collector).queryInfo(0xc0000c0860)
/build/internal/collector/collector.go:128 +0x2a5
github.com/armsnyder/a2s-exporter/internal/collector.(*Collector).Collect(0xc0000c0860, 0xc000060120)
/build/internal/collector/collector.go:68 +0x2d
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
/go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/registry.go:456 +0x10d
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
/go/pkg/mod/github.com/prometheus/client_golang@v1.14.0/prometheus/registry.go:467 +0x55d
@justinnobledev If you could try it with the latest?
This doesn't seem to be panicking anymore for me!
Hi, I'm in the process of building a server tracking website and need to iterate over a lot of servers so I can't give a specific server as an example of which game/server is causing this error,. but every time I run it pretty early into its execution I encounter one of these two
index out of range errors
. The games I'm currently trying to use this on before expanding to other games is CSGO, TF2, Garry's Mod.When it fails to convert bytes to uint