jammsen / docker-palworld-dedicated-server

Docker container to easily provision and manage Palworld Dedicated Server
https://hub.docker.com/r/jammsen/palworld-dedicated-server
MIT License
898 stars 152 forks source link

[Bug Report] RCON config file doesn't update from docker env variables #156

Closed JPL4494 closed 5 months ago

JPL4494 commented 5 months ago

Have you read the Important information text above

Current behavior

Using the latest few images, I am seeing this error in the logs

time="2024-01-31T09:00:05-08:00" level=info msg="cli: execute: auth: rcon: dial tcp: address tcp/###RCON_PORT###: unknown port" channel=stderr iteration=0 job.command=/backupmanager.sh job.position=0 job.schedule="0 * * *

I'm also getting the same errors when I run it via command line within the container

Desired behavior

The startup scripts replace the placeholder values with the environment variables if the RCON functionality is enabled

Links to screenshots

No response

To Reproduce

Steps to reproduce the behavior:

  1. Run latest image in docker with RCON_ENABLED set to true
  2. Wait for the container to startup
  3. Look at logs and see errors

Software setup

Hardware setup

Additional context

I replaced the values manually to see if it works, but now I am getting a connection refused error, so I'm not sure if there are other errors?

jammsen commented 5 months ago

Hey @JPL4494 Please share your default.env and your docker-compose.yml with me. Make sure the passwords are redacted and post it in a code-block please.

JPL4494 commented 5 months ago

docker-compose.yml

version: "3.9"

name: games

###########################
#    EXTENSION  FIELDS    #
###########################

# Common environment values
x-environment: &default-environment
  TZ: $TIMEZONE
  PUID: $PUID
  PGID: $PGID
  UMASK: $UMASK

# Keys common to some of the dependent services/apps
x-common-keys: &common-keys
  restart: unless-stopped

services:
  palworld:
    image: jammsen/palworld-dedicated-server:latest
    container_name: palworld
    <<: *common-keys
    ports:
      - target: 8211 # Gamerserver port inside of the container
        published: ${PALWORD_SERVER_PORT:?err} # Gamerserver port on your host
        protocol: udp
        mode: host
      - target: 25575 # RCON port inside of the container
        published: ${PALWORD_RCON_PORT:?err} # RCON port on your host
        protocol: tcp
        mode: host
    environment:
      <<: *default-environment
      PUBLIC_IP: ${PUBLIC_IP:?err}
      COOP_PLAYER_MAX_NUM: 16
      MAX_PLAYERS: 16
      SERVER_NAME: Cristians_Fantasy
      SERVER_DESCRIPTION: For our lovely little man
      SERVER_PASSWORD: ${PALWORD_GAME_PASSWORD:?err}
      ADMIN_PASSWORD: ${PALWORD_ADMIN_PASSWORD:?err}
      RCON_PORT: 25575
      RCON_ENABLED: true
      COMMUNITY_SERVER: false
      BACKUP_RETENTION_POLICY: true
      BACKUP_RETENTION_AMOUNT_TO_KEEP: 7
      # Game settings
      BUILD_OBJECT_DETERIORATION_DAMAGE_RATE: 0.0
      DEATH_PENALTY: None
      PAL_EGG_DEFAULT_HATCHING_TIME: 0.5
      PAL_CAPTURE_RATE: 1.3
      PAL_SPAWN_NUM_RATE: 1.3
      PAL_STOMACH_DECREACE_RATE: 0.0
      PAL_AUTO_HP_REGENE_RATE_IN_SLEEP: 10
      BASE_CAMP_WORKER_MAXNUM: 20
    volumes:
       - ${FOLDER_FOR_GAME:?err}/palworld:/palworld
       - ${FOLDER_FOR_CONFIGS:?err}/palworld/rcon.yml:/home/steam/steamcmd/rcon.yaml

.env

PALWORD_SERVER_PORT=8211
PALWORD_RCON_PORT=25575
PALWORD_GAME_PASSWORD=some-pass
PALWORD_ADMIN_PASSWORD=another-pass
FOLDER_FOR_GAME=path/to/files
FOLDER_FOR_CONFIGS=another/path/to/files
k997 commented 5 months ago

same error

docker-compose.yaml

version: '3.9'
services:
  palworld-dedicated-server:
    build: .
    container_name: palworld-dedicated-server
    image: jammsen/palworld-dedicated-server:latest
    restart: always
    network_mode: bridge
    ports:
      - target: 8211 # Gamerserver port inside of the container
        published: 8211 # Gamerserver port on your host
        protocol: udp
        mode: host
      - target: 25575 # RCON port inside of the container
        published: 25575 # RCON port on your host
        protocol: tcp
        mode: host
    environment:
      # server config
      - ALWAYS_UPDATE_ON_START=true
      - MAX_PLAYERS=32
      - MULTITHREAD_ENABLED=true
      - COMMUNITY_SERVER=false
      - PUBLIC_IP=0.0.0.0
      - PUBLIC_PORT=8211
      - SERVER_NAME=palworld
      - SERVER_DESCRIPTION=Palworld-Dedicated-Server running in Docker by jammsen
      - SERVER_PASSWORD=None
      - BACKUP_ENABLED=true
      - BACKUP_CRON_EXPRESSION=*/15 * * * *
      # game config
      - PAL_EGG_DEFAULT_HATCHING_TIME=0.000000
      - BUILD_OBJECT_DETERIORATION_DAMAGE_RATE=0.000000
      # rcon
      - RCON_ENABLED=true
      - RCON_PORT=25575
      - ADMIN_PASSWORD=<admin_password>
    volumes:
      - $DOCKER_DATA/palworld:/palworld

error log

palworld-dedicated-server  | time="2024-02-01T12:00:00+08:00" level=info msg=starting iteration=0 job.command=/backupmanager.sh job.position=0 job.schedule="*/15 * * * *"
palworld-dedicated-server  | time="2024-02-01T12:00:00+08:00" level=info msg="cli: execute: auth: rcon: dial tcp: address tcp/###RCON_PORT###: unknown port" channel=stderr iteration=0 job.command=/backupmanager.sh job.position=0 job.schedule="*/15 * * * *"
palworld-dedicated-server  | time="2024-02-01T12:00:05+08:00" level=info msg="cli: execute: auth: rcon: dial tcp: address tcp/###RCON_PORT###: unknown port" channel=stderr iteration=0 job.command=/backupmanager.sh job.position=0 job.schedule="*/15 * * * *"
palworld-dedicated-server  | time="2024-02-01T12:00:05+08:00" level=info msg="cli: execute: auth: rcon: dial tcp: address tcp/###RCON_PORT###: unknown port" channel=stderr iteration=0 job.command=/backupmanager.sh job.position=0 job.schedule="*/15 * * * *"
palworld-dedicated-server  | time="2024-02-01T12:00:06+08:00" level=info msg="cli: execute: auth: rcon: dial tcp: address tcp/###RCON_PORT###: unknown port" channel=stderr iteration=0 job.command=/backupmanager.sh job.position=0 job.schedule="*/15 * * * *"
palworld-dedicated-server  | time="2024-02-01T12:00:06+08:00" level=info msg="cli: execute: auth: rcon: dial tcp: address tcp/###RCON_PORT###: unknown port" channel=stderr iteration=0 job.command=/backupmanager.sh job.position=0 job.schedule="*/15 * * * *"
spuddeh3270 commented 5 months ago

I had the same issue until I added SERVER_SETTINGS_MODE=auto I was then able to use RCON without issue.

acelan commented 5 months ago

I think this should fix the issue.

diff --git a/Dockerfile b/Dockerfile index 2f917d2..a3ce18d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +52,7 @@ VOLUME [ "/palworld" ]

USER steam

-ADD --chown=steam:steam --chmod=440 rcon.yaml ./rcon.yaml +ADD --chown=steam:steam --chmod=440 rcon.yaml /home/Steam/steamcmd/rcon.yaml

ENV DEBIAN_FRONTEND=noninteractive \ PUID=1000 \

jammsen commented 5 months ago

Hey @k997 @JPL4494 - @spuddeh3270 is right, you guys need the SERVER_SETTINGS_MODE=auto option to do that. See here and here

If you set it to manual, you have to provide your own file via volume mount or whatever so seem fit, because it is manual.

I think this should fix the issue.

diff --git a/Dockerfile b/Dockerfile index 2f917d2..a3ce18d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +52,7 @@ VOLUME [ "/palworld" ]

USER steam

-ADD --chown=steam:steam --chmod=440 rcon.yaml ./rcon.yaml +ADD --chown=steam:steam --chmod=440 rcon.yaml /home/Steam/steamcmd/rcon.yaml

ENV DEBIAN_FRONTEND=noninteractive PUID=1000 \

@acelan - This doesnt fix anything, because there is no issue. Your code is exactly 1 to 1 the same as mine, except for the bug with the Uppercase "Steam" username and beeing longer and doing literally the same.

The base-image of steamcmd sets here and here the workdir to /home/steam/steamcmd

JPL4494 commented 5 months ago

@jammsen @spuddeh3270 Got it, I'll try that later. In the meantime, the readme will need to be updated to show the default option for that is set to manual, not auto like it says. I don't set it, so it should default correctly

jammsen commented 5 months ago

@jammsen @spuddeh3270 Got it, I'll try that later. In the meantime, the readme will need to be updated to show the default option for that is set to manual, not auto like it says. I don't set it, so it should default correctly

@JPL4494 The default IS auto IF you use docker-compose and the default.env and its everywhere described as such. You didnt have it in your config so the "absolute-worse-case" got caught by the Dockerfile itself, because there it defaults to manual mode. Thats by design, because of back-wards compability.

https://github.com/jammsen/docker-palworld-dedicated-server/blob/develop/default.env#L12C27-L13C1 - auto https://github.com/jammsen/docker-palworld-dedicated-server/blob/develop/README_ENV.md?plain=1#L23 - auto

https://github.com/jammsen/docker-palworld-dedicated-server/blob/develop/Dockerfile#L66 - manual for absolute worst case and backwards compability to not ruin stuff.

Works just as tested and wanted.

I don't set it, so it should default correctly

Then it did 😎

JPL4494 commented 5 months ago

Got it, I had assumed these were defaulting in the code themselves when ran, as with other docker images, and didn't need a light switch variable to be used

thejcpalma commented 5 months ago

Pushed a fix in the PR, just ran rcon.yaml config independent of settings mode so if the vars exist they are set and rcon works accordingly.

jammsen commented 5 months ago

Not really a fix though, when the users decides to do manual settings, im not touching anything, including rcon.yaml, thats up to them to mount a valid on, again its manual mode. Works as expected.

jammsen commented 5 months ago

Hey @JPL4494 - Im closing this issue as resolved, feel free to reach out again if you need help.

If you like this project, please consider giving this repo and the docker-hub-repo a Star.