Skip to content

Connection refused when trying to connect to RCON on Forge 1.12.2 Server #1012

@Ammatarasu

Description

@Ammatarasu

Hi there!

So I'm trying to get a forge server running on my home server. I would prefer to use docker compose to start it up but i seem to have hit a little snag. It starts up just fine (after a bit of troubleshooting, i think some files were being weird and stuff). But when trying to connect to the server console via rcon with docker exec -i forge rcon-cli --password mine i get the error: "2021/08/23 14:51:01 Failed to connect to RCON serverdial tcp 127.0.0.1:28016: connect: connection refused".

This is my docker-compose.yml:

version: "3"

services:
  mc:
    image: itzg/minecraft-server:java8
    container_name: forge
    ports:
      - 25565:25565
      - 28016:28016
    environment:
      TYPE: "FORGE"
      VERSION: "1.12.2"
      EULA: "TRUE"
      ENABLE_RCON: "true"
      RCON_PORT: 28016
      RCON_PASSWORD: "mine"
      DEBUG: "true"
      MEMORY: "4G"
      ALLOW_FLIGHT: "TRUE"
      OVERRIDE_SERVER_PROPERTIES: "TRUE"
      JVM_DD_OPTS: "fml.queryResult:confirm"
    tty: "true"
    stdin_open: "true"
    restart: unless-stopped
    volumes:
        - ./minecraft-data:/data

I know for sure now its getting stuck on the /fml confirm thing. As you can see i have tried adding the suggestion found in Issue: #465 .
The interesting part is it does let me connect when using docker run and then basically the same variables as i have in my compose file (apart from stdin_open, rcon_password, and jvm_dd_opts). But i would much prefer to use docker-compose for easy startup and shutdown (I don't really want to keep the server running while im not using it).
I've also tried some of the suggestions in Issue: #518 . Mainly:
- adding a --password tag after rcon-cli.
- adding "OVERRIDE_SERVER_PROPERTIES: "TRUE""
- changing the rcon_port to something else.
- changing the rcon properties in server.properties
None of these seem to have made a difference. It does seem like something is happening since if i dont use the right context after rcon-cli (like --pasword) it does give me an error message. When i do docker exec forge grep rcon server.properties it returns:

rcon.port=28016
enable-rcon=true

docker exec forge env returns:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
HOSTNAME=93101d3ac2c3
TYPE=FORGE
VERSION=1.12.2
EULA=TRUE
ENABLE_RCON=true
RCON_PORT=28016
RCON_PASSWORD=mine
DEBUG=true
MEMORY=4G
ALLOW_FLIGHT=TRUE
LANG=C.UTF-8
JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/jre
JAVA_VERSION=8u212
JAVA_ALPINE_VERSION=8.212.04-r0
UID=1000
GID=1000
JVM_XX_OPTS=-XX:+UseG1GC
SERVER_PORT=25565
ONLINE_MODE=TRUE
SERVER_NAME=Dedicated Server
ENABLE_AUTOPAUSE=false
AUTOPAUSE_TIMEOUT_EST=3600
AUTOPAUSE_TIMEOUT_KN=120
AUTOPAUSE_TIMEOUT_INIT=600
AUTOPAUSE_PERIOD=10
AUTOPAUSE_KNOCK_INTERFACE=eth0
HOME=/root

The only time it does seem to sort of work is when i just use docker run instead of docker compose. But then i cant seem to connect to it on my minecraft client. I'm also still pretty new to docker and docker-compose. I've only been able, with lots of struggle, to get a homeassistant instance running so far so any suggestions would be much appreciated :).
Also I wouldn't really know what logs to attach and where i could find them so sorry about that :\

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/staleNo recently activity has been seen and will be closed soon.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions