Not working when i restart the mc server
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 538
- Forks
- 69
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 2
Description
I use a script with rcon-cli to restart the server of minecraft and if i do when mc-backup is working, dont work anymore. When the server is up again cant connect so i restart both at once or only the mc-backup container when mc server is UP.
Here is the debug:
- : /data
- : /backups
- : Vault-Hunters
- : 2m
- : 4h
- : true
- : 10m
- : tar
- : gzip
- : '-3 --long=25 --single-thread'
- : 1
- : '--keep-within 7d'
5 - : mc
5 - : ''
- : serverjk-mc
- : -1
- : 10s
- : '*.jar,cache,logs'
e - : mc_backups
- : /config
e - : Europe/Madrid
- : gzip
- : ''
- : ''
- : ''
- : ''
- : ''
- : ''
- export TZ
- export RCON_HOST
- export RCON_PORT
- export RCON_PASSWORD
- export XDG_CONFIG_HOME
- export SRC_DIR
- export DEST_DIR
- export BACKUP_NAME
- [[ -n '' ]]
- [[ -n '' ]]
- [[ -n '' ]]
- '[' -n '' ']'
- '[' '!' -d /data ']'
- is_function tar
- '[' 1 -ne 1 ']'
- name=tar
++ type -t tar - '[' function == function ']'
- readarray -td, excludes_patterns
++ printf %s '*.jar,cache,logs' - excludes=()
- for pattern in "${excludes_patterns[@]}"
- excludes+=(--exclude "${pattern}")
- for pattern in "${excludes_patterns[@]}"
- excludes+=(--exclude "${pattern}")
- for pattern in "${excludes_patterns[@]}"
- excludes+=(--exclude "${pattern}")
- tar init
- call_if_function_exists init
- '[' 1 -lt 1 ']'
- function_name=init
- is_function init
- '[' 1 -ne 1 ']'
- name=init
++ type -t init - '[' function == function ']'
- init
- mkdir -p /backups
- case "${TAR_COMPRESS_METHOD}" in
- tar_parameters=('--gzip')
- readonly tar_parameters
- readonly backup_extension=tgz
- backup_extension=tgz
- is_one_shot
- [[ FALSE = TRUE ]]
- return 1
- log INFO 'waiting initial delay of 2m...'
- '[' 2 -lt 1 ']'
- local level=INFO
- shift
- valid_levels=('INFO' 'WARN' 'ERROR' 'INTERNALERROR')
- local valid_levels
- is_elem_in_array INFO INFO WARN ERROR INTERNALERROR
- '[' 5 -lt 2 ']'
- local element=INFO
- shift
e - for e in "$@"
- '[' INFO == INFO ']'
- return 0
- '[' 1 -ge 1 ']'
- cat -
- awk -v level=INFO '{ printf("%s %s %s\n", strftime("%FT%T%z"), level, $0); fflush(); }'
2022-09-01T16:35:51+0200 INFO waiting initial delay of 2m... - '[' INFO == INTERNALERROR ']'
- sleep 2m
- log INFO 'waiting for rcon readiness...'
- '[' 2 -lt 1 ']'
- local level=INFO
- shift
- valid_levels=('INFO' 'WARN' 'ERROR' 'INTERNALERROR')
- local valid_levels
- is_elem_in_array INFO INFO WARN ERROR INTERNALERROR
- '[' 5 -lt 2 ']'
- local element=INFO
- shift
e - for e in "$@"
- '[' INFO == INFO ']'
- return 0
- '[' 1 -ge 1 ']'
- cat -
- awk -v level=INFO '{ printf("%s %s %s\n", strftime("%FT%T%z"), level, $0); fflush(); }'
2022-09-01T16:37:51+0200 INFO waiting for rcon readiness... - '[' INFO == INTERNALERROR ']'
- retry -1 10s rcon-cli save-on
- '[' 4 -lt 3 ']'
- local retries=-1
- local interval=10s
- readonly retries interval
2 - (( retries < 0 ))
- local retries_msg=infinite
- local i=-1
- (( retries >= ++i ))
- '[' infinite '!=' -1 ']'
++ timeout --signal=SIGINT --kill-after=30s 5m rcon-cli save-on
++ tr '\n' '\t' - output='2022/09/01 16:37:51 Failed to connect to RCON serverdial tcp: lookup mc on 127.0.0.11:53: read udp 127.0.0.1:43190->127.0.0.11:53: read: connection refused '
- log ERROR 'Unable to execute rcon-cli save-on - try 0/infinite. Retrying in 10s'
- '[' 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
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(); }'
2022-09-01T16:37:51+0200 ERROR Unable to execute rcon-cli save-on - try 0/infinite. Retrying in 10s - '[' ERROR == INTERNALERROR ']'
- '[' -n '2022/09/01 16:37:51 Failed to connect to RCON serverdial tcp: lookup mc on 127.0.0.11:53: read udp 127.0.0.1:43190->127.0.0.11:53: read: connection refused ' ']'
- log ERROR 'Failure reason: 2022/09/01 16:37:51 Failed to connect to RCON serverdial tcp: lookup mc on 127.0.0.11:53: read udp 127.0.0.1:43190->127.0.0.11:53: read: connection refused '
...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Start by reproducing a Minecraft server restart while mc-backup is running and inspect the rcon-cli readiness and retry path, especially the Docker DNS failure shown in the log. Done means the backup container reconnects to RCON after the server returns without needing a container restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100