itzg / itzg/docker-mc-backup

Error querying the server when using authentication mod

Open
#173 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
538
Forks
69
Avg merge
3h 28m
Merged PRs (30d)
2

Description

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

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported `mc-monitor status --host caz --port 25565 --show-player-count` command with an authentication mod enabled. Inspect the `java_status.go` location named in the debug output and trace how the query handles authentication; no repository file or test is identified. Done means this scenario no longer produces the connection error and retry message.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.