itzg / itzg/docker-mc-backup

Help: Unable to get mc-backup working, cannot connect to RCON.

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

Description

Hi, me again. Realised I wasn't running backups for my server the past 6 months when I thought I was. So, went about getting backups started and found this repo. Just having some teething issues getting it working and would appreciate any guidance you could share! This is the following issue I am seeing in the logs of my "minecraft_backups_1" container that is running.

```
2021-07-11T17:41:14+0000 ERROR Unable to execute rcon-cli save-on - try 0/20. Retrying in 10s,
2021-07-11T17:41:14+0000 ERROR Failure reason: 2021/07/11 17:41:14 Failed to connect to RCON serverdial tcp 127.0.0.1:25575: connect: connection refused
```

The `docker-compose.yml` file I used is as follows:

```yml
version: '3.7'

services:
backups:
image: itzg/mc-backup
environment:
BACKUP_INTERVAL: "1d"
BACKUP_NAME: "new-survival" # I put this as the name of my world incase they needed to match, was unsure
PRUNE_BACKUP_DAYS: "7"
EXCLUDES: ".jar,cache,logs"
BACKUP_METHOD: "tar"
INITIAL_DELAY: 30s
# instead of network_mode below, could declare RCON_HOST
RCON_HOST: minecraft # tried this with localhost as well but to no avail
RCON_PORT: 25575 # default
RCON_PASSWORD: minecraft # default
volumes:
# mount the same volume used by server, but read-only
- minecraft:/data:ro
# use a host attached directory so that it in turn can be backed up
# to external/cloud storage
- ./mc-backups:/backups # I have created a directory called `mc-backups` at the same level as this file
# share network namespace with server to simplify rcon access - there is no minecraft service yet.
# network_mode: "service:minecraft"
networks:
mc-backup:
restart: unless-stopped

volumes:
minecraft: {} # I think this needs mapping to my volume used for the server but was unable to do so, hence changed in portainer

# Saw this mentioned in Issue 5 for this repo and thought I may need it.
networks:
mc-backup:
internal: true

```

Once the container has booted, I always need to change the `/data` for the read-only aspect as it never points at the volume I use for my server container (likely a config issue in the script but easy enough to change on portainer). I think the issue is to do with networking/services? I don't have a "minecraft" service running on my box - I didn't use docker-compose file for setting that up.

Very much on a learning curve with containers currently so any guidance appreciated. If you need any more details please let me know. Have read the documentation but wasn't able to get anywhere.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the supplied docker-compose.yml and the minecraft_backups_1 logs, checking the declared services, RCON settings, and /data volume mapping. Done means the backup container connects to RCON and uses the intended Minecraft server volume without manual changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.