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

Having trouble connecting to the rcon #12

Open
sabinM1 opened this issue May 20, 2021 · 18 comments
Open

Having trouble connecting to the rcon #12

sabinM1 opened this issue May 20, 2021 · 18 comments

Comments

@sabinM1
Copy link

sabinM1 commented May 20, 2021

Hello,

I have a minecraft server running in a docker container and I can't connect to it via this tool.
Screenshot from 2021-05-20 18-59-48

I've checked the other issues and tried what I could, but no success.

My docker-compose for the server is:

version: "3.8"

services:
  minecraft-server:
    image: "itzg/minecraft-server:multiarch-latest"
    container_name: "mc-pi"
    ports:
      - "25565:25565"
      - "4711:4711"
    volumes:
      - "~/mc/data:/data"
    networks:
      - Minecraft
    environment:
      EULA: "true"
      ENABLE_RCON: "true"
      RCON_PASSWORD: "sabin"
      RCON_PORT: 25575
      TYPE: "PURPUR"
      VERSION: "1.16.5"
      PURPUR_BUILD: "LATEST"
      MEMORY: "1000m"
    tty: true
    stdin_open: true
    restart: always

volumes:
  mc:

networks:
  Minecraft:

And the docker-compose for the rcon is:

version: "3.8"

services:
  web:
    image: itzg/rcon
    environment:
      RWA_USERNAME: admin
      RWA_PASSWORD: sabin
      RWA_ADMIN: "TRUE"
      RWA_RCON_HOST: minecraft-server
      RWA_RCON_PASSWORD: sabin
    ports:
      - 4326:4326
      - 4327:4327
    networks:
      - other

networks:
  other:
    external: true
    name: mc_default

The folder structure is as follows:

.
├── mc
│   ├── data
│   ├── docker-compose.yml
└── rcon
    └── docker-compose.yml

Also the docker network:

docker network ls
NETWORK ID     NAME              DRIVER    SCOPE
3330c2b424c3   bridge            bridge    local
403bf6ad6186   host              host      local
f4a2d89db847   mc_Minecraft      bridge    local
a7593566ae8d   mc_default        bridge    local
a78b132a0a4a   none              null      local
66d83ced9f93   web               bridge    local
CONTAINER ID   IMAGE                                    COMMAND                  CREATED          STATUS                    PORTS                                                                                                 NAMES
481df532f24d   itzg/rcon                                "/usr/local/bin/node…"   14 minutes ago   Up 14 minutes             0.0.0.0:4326-4327->4326-4327/tcp, :::4326-4327->4326-4327/tcp                                         rcon_web_1
5167a15b7446   itzg/minecraft-server:multiarch-latest   "/start"                 18 minutes ago   Up 18 minutes (healthy)   0.0.0.0:4711->4711/tcp, :::4711->4711/tcp, 0.0.0.0:25565->25565/tcp, :::25565->25565/tcp, 25575/tcp   mc-pi

I've also tried using only one docker-compose file, same results:

version: "3.8"

services:
  minecraft-server:
    image: "itzg/minecraft-server:multiarch-latest"
    container_name: "mc-pi"
    ports:
      - "25565:25565"
      - "4711:4711"
    volumes:
      - "~/mc/data:/data"
#    networks:
#      - Minecraft
    environment:
      EULA: "true"
      ENABLE_RCON: "true"
      RCON_PASSWORD: "sabin"
      RCON_PORT: 25575
      TYPE: "PURPUR"
      VERSION: "1.16.5"
      PURPUR_BUILD: "LATEST"
      MEMORY: "1000m"
    tty: true
    stdin_open: true
    restart: always
  web:
    image: itzg/rcon
    environment:
      RWA_USERNAME: admin
      RWA_PASSWORD: admin
      RWA_ADMIN: "TRUE"
      # is referring to the hostname of 'mc' compose service below
      RWA_RCON_HOST: minecraft-server
      # needs to match the password configured for the container, which is 'minecraft' by default
      RWA_RCON_PASSWORD: sabin
    ports:
      - 4326:4326
      - 4327:4327

volumes:
  mc:

Any help is much appreciated! Thanks in advance!

@itzg
Copy link
Owner

itzg commented Jun 1, 2021

Do the rcon web container logs show anything? Try adding the env var OVERRIDE_SERVER_PROPERTIES: "true" to your minecraft-server service since it may not be updating the server properties with your desired rcon password.

@Esmeralddd
Copy link

Esmeralddd commented Dec 11, 2021

Same problem here.

with this docker-compose.yml file:

version: '3.3'

services:
  web:
    image: itzg/rcon
    container_name: web
    environment:
      RWA_USERNAME: admin
      RWA_PASSWORD: admin
      RWA_ADMIN: "TRUE"
      RWA_RCON_HOST: 127.0.0.1
      # is referring to the hostname of 'mc' compose service below
      # needs to match the password configured for the container, which is 'minecraft' by default
      RWA_RCON_PASSWORD: minecraft
      RWA_RCON_PORT: 32648
    ports:
      - 4326:4326
      - 4327:4327
  mc:
    container_name: mc
    image: itzg/minecraft-server
    ports:
      - 25565:25565
      - 32648:25575
    environment:
      OVERRIDE_SERVER_PROPERTIES: "TRUE"
      EULA: "TRUE"
      ENABLE_RCON: "TRUE"
      RCON_PORT: 25575

Doesn't work either with RWA_RCON_HOST set to mc

@csmykay
Copy link

csmykay commented Jun 10, 2022

I have the same issue. I just completely deleted my old MC volume and all old images and re-setup everything with your sample compose file:
`version: '3.3'

services:
web:
image: itzg/rcon
environment:
RWA_USERNAME: admin
RWA_PASSWORD: minecraft
RWA_ADMIN: "TRUE"
# is referring to the hostname of 'mc' compose service below
RWA_RCON_HOST: mc
# needs to match the password configured for the container, which is 'minecraft' by default
RWA_RCON_PASSWORD: minecraft
ports:
- 4326:4326
- 4327:4327
mc:
image: itzg/minecraft-server
ports:
- 25565:25565
environment:
EULA: "TRUE"
TZ: America/Chicago
restart: always`

Log after start-up:

[18:37:16] [Worker-Main-8/INFO]: Preparing spawn area: 97% [18:37:20] [Server thread/INFO]: Time elapsed: 265595 ms [18:37:20] [Server thread/INFO]: Done (339.510s)! For help, type "help" [18:37:20] [Server thread/INFO]: Starting remote control listener [18:37:20] [Server thread/INFO]: Thread RCON Listener started [18:37:20] [Server thread/INFO]: RCON running on 0.0.0.0:25575 [18:37:29] [RCON Listener #1/INFO]: Thread RCON Client /172.19.0.3 started
Only I changed was the TZ setting and the restart flag. What am I missing here?`

BTW I also tried to change the server in the RCON Web admin to the local IP which was
172.190.2 as well as the docker server name:

b42a062394f0 itzg/minecraft-server "/start" 16 hours ago Up 16 hours (healthy) 0.0.0.0:25565->25565/tcp, :::25565->25565/tcp, 25575/tcp mincecraft_mc_1

@csmykay
Copy link

csmykay commented Jun 10, 2022

And there is nothing in the log files on the RCON container:

root@neutral:~# docker exec -it 2c64df3217db /bin/bash
root@2c64df3217db:/opt/rcon-web-admin-0.14.1# ls
CHANGELOG.md LICENSE README.md config.template.js db logs node_modules package-lock.json package.json public src startscripts
root@2c64df3217db:/opt/rcon-web-admin-0.14.1# cd logs/
root@2c64df3217db:/opt/rcon-web-admin-0.14.1/logs# ls
root@2c64df3217db:/opt/rcon-web-admin-0.14.1/logs# ls -lha
total 12K
drwxr-xr-x 1 root root 4.0K Jun 9 2020 .
drwxrwxr-x 1 root root 4.0K Apr 17 2021 ..
-rwxr-xr-x 1 root root 14 Jun 9 2020 .gitignore
root@2c64df3217db:/opt/rcon-web-admin-0.14.1/logs#

@itzg
Copy link
Owner

itzg commented Jun 12, 2022

Using the example still works fine for me:

https://github.com/itzg/docker-rcon-web-admin/blob/master/docker-compose.yml

Start from there and make one change at a time until you find where the config is wrong.

@csmykay
Copy link

csmykay commented Jun 14, 2022

Like I said that was the compose example I used. I only added the restart always and the TimeZone option. But I will retry again without those set.

@csmykay
Copy link

csmykay commented Jun 21, 2022

Same thing, blank slate using default compose config. No error in the rcon running container or with RCON on the minecraft container. What does you local docker network look like? Here is mine:

NETWORK ID NAME DRIVER SCOPE
6c2c200e1038 bridge bridge local
6939184122b5 docker_gwbridge bridge local
b2cec049348e host host local
2idosj5app99 ingress overlay swarm
985a7249b06f mincecraft_default bridge local
60d0daeee531 mysql_default bridge local
5bbb86b78933 none null local
a814c9db6938 teamspeak_default bridge local

root@neutral:~/Compose-configs/mincecraft# docker inspect 985a7249b06f
[
{
"Name": "mincecraft_default",
"Id": "985a7249b06f892d86417144b833e39b11e15ba8da2255be31a061ea72541f5d",
"Created": "2022-06-21T09:14:21.946529785-05:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.19.0.0/16",
"Gateway": "172.19.0.1"
}
]
},
"Internal": false,
"Attachable": true,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"9e71933c8e0725586b6452a1bfc975d2c3fa36da421a75691fd336c2d3185a25": {
"Name": "mincecraft_mc_1",
"EndpointID": "676ed6680cee1fa5c9b07f6b9d4085b2ceffca8562033029b6b2fcc586e277bf",
"MacAddress": "02:42:ac:13:00:02",
"IPv4Address": "172.19.0.2/16",
"IPv6Address": ""
},
"a15a0be5db4384e658f8dd075d3936d23bbc29809f2abc3345cfc207ccf05546": {
"Name": "mincecraft_web_1",
"EndpointID": "96ad5d7b99c97ac4eb51956380f9187d707527a8828ab5584086b37b372c44b3",
"MacAddress": "02:42:ac:13:00:03",
"IPv4Address": "172.19.0.3/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {
"com.docker.compose.network": "default",
"com.docker.compose.project": "mincecraft",
"com.docker.compose.version": "1.25.0"
}
}
]

root@neutral:~/Compose-configs/mincecraft# docker inspect bridge
[
{
"Name": "bridge",
"Id": "6c2c200e103846f044345416be34ca9482eb04c1c8c8f546eb11bfa91f07c3aa",
"Created": "2022-06-21T09:09:21.061988128-05:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Labels": {}
}
]

That's all I can think of.

@itzg
Copy link
Owner

itzg commented Jun 27, 2022

PS D:\> docker network ls
NETWORK ID     NAME                DRIVER    SCOPE
3d28cb1cd485   bridge              bridge    local
6dcf3491c762   host                host      local
17bd9d5a5478   minecraft_default   bridge    local
8d2aed6bc5c0   none                null      local
a7881a2cadb1   packwiz_default     bridge    local
PS D:\> docker inspect 17bd9d5a5478
[
    {
        "Name": "minecraft_default",
        "Id": "17bd9d5a5478f6818fe0843fdef7d686713db66a93bcc17ecb0aaf86a3fd456e",
        "Created": "2022-06-27T13:17:44.7046221Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.28.0.0/16",
                    "Gateway": "172.28.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "bb67e52d48c0349712e90b4b2643246db1f3028e03c432e54f10e0f0183c534b": {
                "Name": "minecraft-web-1",
                "EndpointID": "20dbf7b08266e7f597f571ce631f0fbd71ebe2bfa05f329b2f41cdac9dec1bcc",
                "MacAddress": "02:42:ac:1c:00:03",
                "IPv4Address": "172.28.0.3/16",
                "IPv6Address": ""
            },
            "e5786456af9f81416e0a5bf736e9781bc9cff194652a1b16b7767626ea6ea3ec": {
                "Name": "minecraft-mc-1",
                "MacAddress": "02:42:ac:1c:00:02",
                "IPv4Address": "172.28.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "default",
            "com.docker.compose.project": "minecraft",
            "com.docker.compose.version": "2.6.0"
        }
    }
]
PS D:\> docker inspect bridge
[
    {
        "Name": "bridge",
        "Id": "3d28cb1cd4852793f289f92b1ddb119b6539cb2003221873ca1f2e913cf578a3",
        "Created": "2022-06-18T02:02:55.1381223Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "2c0f3c6645ddbe6c66472781259a9cfe628a8f2567572c09742dc90a06c75787": {
                "Name": "confident_visvesvaraya",
                "EndpointID": "e1b733e9d26b9c61aaa35efa965fbd3183873d7ba1bcdc37f5241176a5ce3ed3",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

@benjamin051000
Copy link

Same issue here. Using provided docker compose file with 0 modifications. I get the same image as OP.

@benjamin051000
Copy link

benjamin051000 commented May 22, 2023

I'm seeing the following in the rcon admin container logs:

2023-05-22T13:34:29.034Z Invalid rcon password for server minecraft:25575
{"host":null,"websocketUrlSsl":null,"websocketUrl":null,"port":4326}�\00\00\00\00\00\00J2023-05-22T13:36:51.115Z Invalid rcon password for server minecraft:25575

Could this be part of the issue? I am using the example compose file here: https://github.com/itzg/docker-rcon-web-admin/blob/master/docker-compose.yml. I haven't changed anything from that.

One thing of note: When I run through portainer, the container names are modified to be this:

minecraft-web-1
minecraft-mc-1

The name of the Portainer stack I created was called "minecraft."

@itzg
Copy link
Owner

itzg commented May 22, 2023

Sorry, I had forgotten to update the example due to the default, randomized RCON password feature. Please use the latest:

https://github.com/itzg/docker-rcon-web-admin/blob/master/docker-compose.yml

@benjamin051000
Copy link

Looks like it works now. Thanks!

@Amonbofils83
Copy link

Amonbofils83 commented Jul 3, 2023

Hi, I'm still having this issue, i set the password in my docker-compose.yml but it still changes everytime. So i cannot connect to rcon :

minecraft-kingdom-survie:
image: itzg/minecraft-server
ports:
- 25570:25565
- 25575:25575
environment:
EULA: "TRUE"
MODE: "creative"
MEMORY: "4G"
ONLINE_MODE: "FALSE"
# password needs to be explicitly set,
# otherwise random one is generated at each startup
RCON_PASSWORD: "demo"
tty: true
stdin_open: true
restart: unless-stopped
volumes:
# attach a directory relative to the directory containing this compose file
- /home/Config/MinecraftJavaKingdomSurvie:/data

webMc:
image: itzg/rcon
environment:
RWA_USERNAME: admin
RWA_PASSWORD: admin
RWA_ADMIN: "TRUE"
# is referring to the hostname of 'mc' compose service below
RWA_RCON_HOST: minecraft-kingdom-survie
# needs to match the RCON_PASSWORD configured for the container
RWA_RCON_PASSWORD: "demo"
RWA_RCON_PORT: 25575
ports:
- 4326:4326
- 4327:4327

any idea ?

@itzg
Copy link
Owner

itzg commented Jul 3, 2023

As far as the RCON_PASSWORD generation, I am not able to recreate that part of the issue. Creating a container with

> docker run -it --rm -d --name mc -e EULA=true -e RCON_PASSWORD=demo itzg/minecraft-server

and then checking the properties file shows the requested password:

> docker exec mc cat server.properties | grep rcon.password
rcon.password=demo

@itzg
Copy link
Owner

itzg commented Jul 3, 2023

I just tried a fresh instance and the example still works fine for me https://github.com/itzg/docker-rcon-web-admin/blob/master/docker-compose.yml

@csmykay
Copy link

csmykay commented Jan 30, 2024

Just as an update I have never got this to work on my home configuration. I used your default compose configuration and it has never worked. It looks like the web rcon connects:

[16:59:35] [RCON Listener #1/INFO]: Thread RCON Client /172.28.0.2 started

But the screen is just blank (I used to get the error of "perhaps it is down". So an improvement but still not working. I am about to just blow my entire docker install away and retry.

@csmykay
Copy link

csmykay commented Jan 30, 2024

I just completely re-installed docker and removed all volumes and images and still does not work. There are not even any logs in the rcon container to TS. So if anyone get's it to work would appreciate and tips you have.

@kennyiv
Copy link

kennyiv commented Aug 22, 2024

I had issues running this docker image for the longest time as well. I did not realize that both ports 4326 and 4327 need to be available to get the WebUI to work. Using F12 / looking at the web console it will throw an error every few seconds that it can't connect to the 4327 port if you access the webpage over 4326. Port-forwarding / allowing both ports access to the browser fixed it for me

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

7 participants