Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to connect to RCON serverdial #99

Open
kylerhenry opened this issue Aug 6, 2022 · 7 comments
Open

Failing to connect to RCON serverdial #99

kylerhenry opened this issue Aug 6, 2022 · 7 comments

Comments

@kylerhenry
Copy link

kylerhenry commented Aug 6, 2022

I'm using the following compose file:

version: '3.9'

services:
  minecraft:
    container_name: minecraft-atm7
    image: itzg/minecraft-server:java17
    ports:
      - "25565:25565"
    restart: unless-stopped
    stdin_open: true
    tty: true
    environment:
      EULA: "TRUE"
      WORLD: /worlds/world
      MEMORY: 16G
      JVM_XX_OPTS: "-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=32M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -X>
      TYPE: FORGE
      VERSION: 1.18.2
      STOP_SERVER_ANNOUNCE_DELAY: 300
      # Need to manually rev these (place downloaded pack in ./modpacks). This will be pulled in unless SKIP_GENERIC_PACK_UPDATE_CHECK: false is set here.
      FORGEVERSION: 40.1.68
      GENERIC_PACK: /modpacks/Server-Files-0.4.24.zip
      # UUID ops here
      OPS: 9d5101ef-4f07-431e-b86c-cc734e8a5952
      # Server listing info
      # config options
      DIFFICULTY: normal
    volumes:
      # maps from host:container for data persistence
      - ./data:/data
      - ./modpacks:/modpacks:ro
      - ./worlds:/worlds:ro
    # Docker reservations
    mem_limit: 25g
    mem_reservation: 18g
    # cpus: 0.5
  backups:
    container_name: backup-atm7
    image: itzg/mc-backup
    environment:
      SERVER_PORT: 25565
      # timing
      BACKUP_INTERVAL: "1h"
      INITIAL_DELAY: "2m"
      # online player
      PAUSE_IF_NO_PLAYERS: "true"
      PLAYERS_ONLINE_CHECK_INTERVAL: "2m"
      PRUNE_BACKUPS_DAYS: 2
      # method info
      BACKUP_METHOD: tar
      DEST_DIR: /backups
      TAR_COMPRESS_METHOD: zstd
      ZSTD_PARAMETERS: "-11 --long --single-thread"
    volumes:
      # IMPORTANT: Must mount to same location as server data volume above
      - ./data:/data:ro
      # Where the backups will be saved to
      - /media/HDD/game_backups/mc/ATM7/0.4.24:/backups
    # share network namespace with server to simplify rcon access
    network_mode: "service:minecraft"

And receiving the following error:

Unable to execute rcon-cli save-on - try 0/5. Retrying in 10s
Failure reason: 2022/08/06 Failed to RCON serverdial tcp 127.0.0.1:25575: connect: connection refused

Running on headless Ubuntu. I've tried looking at some of the other bug reports here with similar issues, but I can't seem to figure this one out. Is this expected since I'm specifying tar mode?

@kylerhenry
Copy link
Author

kylerhenry commented Aug 6, 2022

It looks like the backup docker is stopped every time this error comes up, but perhaps it's stopped until the next backup iteration time?

Edit: This isn't the case; no backup was created at the specified time
I tried adding a RCON_PASSWORD: entry to the server (thinking maybe the default wasn't being populated) but that didn't help either.

@itzg
Copy link
Owner

itzg commented Aug 8, 2022

In the minecraft container logs can you locate lines that look like this:

[13:39:42] [Server thread/INFO]: Starting remote control listener
[13:39:42] [Server thread/INFO]: Thread RCON Listener started
[13:39:42] [Server thread/INFO]: RCON running on 0.0.0.0:25575

@kylerhenry
Copy link
Author

@itzg Negative:
image

@itzg
Copy link
Owner

itzg commented Aug 9, 2022

That would explain why the backup container can't connect with rcon. The modpack must be interfering somehow.

@kylerhenry
Copy link
Author

kylerhenry commented Aug 12, 2022

I ended up just writing a bash script to do the backups for me since I don't really want to deal with tracking down a bug in over 300 mods in the pack.

@chriscn
Copy link

chriscn commented Sep 4, 2022

Just adding my issue and solution here; if you are using a modpack that provides you with a server download, rcon may be disabled by default. You can enable it on line 12 of server.properties

@drloloto
Copy link

Just adding my issue and solution here; if you are using a modpack that provides you with a server download, rcon may be disabled by default. You can enable it on line 12 of server.properties

Thanks, it's so simple I'm so stupid. for paper server the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants