itzg / docker-mc-backup

Provides a side-car container to backup itzg/minecraft-server world data
https://hub.docker.com/r/itzg/mc-backup
MIT License
332 stars 52 forks source link

Error querying the server when using authentication mod #173

Open Andision opened 7 months ago

Andision commented 7 months ago

When using some auth mod like AuthMe, it will return ERROR Error querying the server, waiting 5m.... This seems to be because the mc-monitor try to query the player count by port 25565, but this action need authentication. The debug information is below

++ mc-monitor status --host caz --port 25565 --show-player-count
+ PLAYERS_ONLINE='2024-03-29T15:14:43.236Z      DEBUG   mc-monitor/java_status.go:82    pinging
2024-03-29T15:14:43.237Z        DEBUG   mc-monitor/java_status.go:85    ping returned   {"error": "could not connect to Minecraft server: dial tcp 172.22.0.2:25565: connect: connection refused", "info": null}
failed to ping caz:25565 : could not connect to Minecraft server: dial tcp 172.22.0.2:25565: connect: connection refused'
+ log ERROR 'Error querying the server, waiting 5m...'
+ '[' 2 -lt 1 ']'
+ local level=ERROR
+ shift
+ valid_levels=('INFO' 'WARN' 'ERROR' 'INTERNALERROR')
+ local valid_levels
+ is_elem_in_array ERROR INFO WARN ERROR INTERNALERROR
+ '[' 5 -lt 2 ']'
+ local element=ERROR
+ shift
+ local e
+ for e in "$@"
+ '[' ERROR == INFO ']'
+ for e in "$@"
+ '[' ERROR == WARN ']'
+ for e in "$@"
+ '[' ERROR == ERROR ']'
+ return 0
+ '[' 1 -ge 1 ']'
+ cat -
+ awk -v level=ERROR '{ printf("%s %s %s\n", strftime("%FT%T%z"), level, $0); fflush(); }'
2024-03-29T15:14:43+0000 ERROR Error querying the server, waiting 5m...
+ '[' ERROR == INTERNALERROR ']'
+ sleep 5m
itzg commented 7 months ago

Interesting. Do you mind locating any documentation about AuthMe's changes to the Minecraft protocol?