palworld-server-docker: Player Save Data Corrupted on Restart

Describe the bug

Player save data (at /Pal/Saved/SaveGames/0/643B916545D6886A839265911924FBEC/Players/) is occasionally corrupted on server restart.

To Reproduce

Steps to reproduce the behavior:

  1. Have a server with multiple players
  2. Reboot the server, either with the auto-restart functionality, or docker-compose down && docker-compose up -d
  3. Have the players rejoin
  4. See players’ save data has been overwritten (timestamp on files are changed to time of server restart) and players see the new character creation screen.

Expected behavior

Restarting the server does not affect the player save data

Actual behavior

Restarting the server corrupts/overwrites the player save data

Screenshots

Restarted server at 10:29 Screenshot 2024-02-26 at 15 41 20 Player data for those two characters is corrupted and has to be restored from backup.

OS information

  • OS: Debian GNU/Linux 12 (bookworm) x86_64
  • Palworld Version: v0.1.4.1
  • Docker Image Version: latest

Hardware information

  • CPU: Intel i3-10110U (4) @ 4.100GHz
  • Memory: 16gb

docker-compose.yml contents

services:
  palworld:
    image: thijsvanloef/palworld-server-docker:latest
    restart: unless-stopped
    container_name: palworld-server
    stop_grace_period:
      30s # Set to however long you are willing to wait for the container to gracefully stop
    ports:
      - 8211:8211/udp
      - 27015:27015/udp
    volumes:
      - .:/palworld/
    env_file:
      - server.env
TZ=EST
PLAYERS=8
PORT=8211
MULTITHREADING=true
COMMUNITY=true
PUBLIC_IP=lenwohl.dev
PUBLIC_PORT=8211
SERVER_NAME=lenwohl.dev
SERVER_DESCRIPTION=
UPDATE_ON_BOOT=true
RCON_ENABLED=true
RCON_PORT=25575
QUERY_PORT=27015
BACKUP_ENABLED=true
DELETE_OLD_BACKUPS=true
OLD_BACKUP_DAYS=30
BACKUP_CRON_EXPRESSION=0 * * * *
AUTO_UPDATE_ENABLED=false
AUTO_UPDATE_CRON_EXPRESSION=0 * * * *
AUTO_UPDATE_WARN_MINUTES=30
AUTO_REBOOT_ENABLED=false
AUTO_REBOOT_EVEN_IF_PLAYERS_ONLINE=false
AUTO_REBOOT_WARN_MINUTES=5
AUTO_REBOOT_CRON_EXPRESSION=30 5 * * *
ENABLE_PLAYER_LOGGING=true
PLAYER_LOGGING_POLL_PERIOD=5

DIFFICULTY=None
DAYTIME_SPEEDRATE=1.000000
NIGHTTIME_SPEEDRATE=1.000000
EXP_RATE=1.000000
PAL_CAPTURE_RATE=1.000000
PAL_SPAWN_NUM_RATE=1.000000
PAL_DAMAGE_RATE_ATTACK=1.000000
PAL_DAMAGE_RATE_DEFENSE=1.000000
PLAYER_DAMAGE_RATE_ATTACK=1.000000
PLAYER_DAMAGE_RATE_DEFENSE=1.000000
PLAYER_STOMACH_DECREASE_RATE=1.000000
PLAYER_STAMINA_DECREASE_RATE=1.000000
PLAYER_AUTO_HP_REGEN_RATE=1.000000
PLAYER_AUTO_HP_REGEN_RATE_IN_SLEEP=1.000000
PAL_STOMACH_DECREASE_RATE=1.000000
PAL_STAMINA_DECREASE_RATE=1.000000
PAL_AUTO_HP_REGEN_RATE=1.000000
PAL_AUTO_HP_REGEN_RATE_IN_SLEEP=1.000000
BUILD_OBJECT_DAMAGE_RATE=1.000000
BUILD_OBJECT_DETERIORATION_DAMAGE_RATE=1.000000
COLLECTION_DROP_RATE=1.000000
COLLECTION_OBJECT_HP_RATE=1.000000
COLLECTION_OBJECT_RESPAWN_SPEED_RATE=1.000000
ENEMY_DROP_ITEM_RATE=1.000000
DEATH_PENALTY=All
ENABLE_PLAYER_TO_PLAYER_DAMAGE=False
ENABLE_FRIENDLY_FIRE=False
ENABLE_INVADER_ENEMY=False
ACTIVE_UNKO=False
ENABLE_AIM_ASSIST_PAD=True
ENABLE_AIM_ASSIST_KEYBOARD=True
DROP_ITEM_MAX_NUM=3000
DROP_ITEM_MAX_NUM_UNKO=100
BASE_CAMP_MAX_NUM=128
BASE_CAMP_WORKER_MAX_NUM=15
DROP_ITEM_ALIVE_MAX_HOURS=1.000000
AUTO_RESET_GUILD_NO_ONLINE_PLAYERS=False
AUTO_RESET_GUILD_TIME_NO_ONLINE_PLAYERS=72.00000
GUILD_PLAYER_MAX_NUM=20
PAL_EGG_DEFAULT_HATCHING_TIME=4.00000
WORK_SPEED_RATE=1.000000
IS_MULTIPLAY=False
IS_PVP=False
CAN_PICKUP_OTHER_GUILD_DEATH_PENALTY_DROP=False
ENABLE_NON_LOGIN_PENALTY=True
ENABLE_FAST_TRAVEL=True
IS_START_LOCATION_SELECT_BY_MAP=True
EXIST_PLAYER_AFTER_LOGOUT=False
ENABLE_DEFENSE_OTHER_GUILD_PLAYER=False
COOP_PLAYER_MAX_NUM=4
REGION=
USEAUTH=True
BAN_LIST_URL=https://api.palworldgame.com/api/banlist.txt

Container/Host Logs

****EXECUTING USERMOD****

usermod: no changes

****Checking for new update****

Current Version: 6370735655629434989

The Server is up to date!

****GENERATING CONFIG****

Using Env vars to create PalWorldSettings.ini

****Compiling PalWorldSettings.ini****

Compiling PalWorldSettings.ini done!

****GENERATING CRONTAB****

BACKUP_ENABLED=true

Adding cronjob for auto backups

Cronjobs started

****Starting Server****

./PalServer.sh -port=8211 -queryport=27015 EpicApp=PalServer -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS

time="2024-02-26T14:49:29-05:00" level=info msg="read crontab: /home/steam/server/crontab"

setrlimit() failed with error 22 (Invalid argument)

- Max per-process value allowed is 0 (we wanted infinity).

[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.

Shutdown handler: initalize.

Increasing per-process limit of core file size to infinity.

CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize

Setting breakpad minidump AppID = 2394010

[S_API FAIL] Tried to access Steam interface SteamUser021 before SteamAPI_Init succeeded.

[S_API FAIL] Tried to access Steam interface SteamFriends017 before SteamAPI_Init succeeded.

[S_API FAIL] Tried to access Steam interface STEAMAPPS_INTERFACE_VERSION008 before SteamAPI_Init succeeded.

[S_API FAIL] Tried to access Steam interface SteamNetworkingUtils004 before SteamAPI_Init succeeded.

Additional context

This happens very frequently, but not every time. It happens to some users more than others, but I can’t figure out a pattern. Thanks for your help, I appreciate your maintenance of this fun project.

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Reactions: 2
  • Comments: 19 (4 by maintainers)

Most upvoted comments

@leonardwohl I kept seeing this as well after restarting the container, not for all players. Eventually took a diff on the unpacked player save files (via palworld-save-tools) comparing to the working backups. For my case, the field being corrupted was save_game_class_name which was set to “None.PalWorldPlayerSaveGame” for the faulty saves and “/Script/Pal.PalWorldPlayerSaveGame” for the working saves. After patching that field, the players were able to login again. I’ve since found and incorporated this into my docker-compose.yml which fixes the issue on the files directly without converting to/from JSON: https://github.com/YDKK/palworld-save-repair

Hopefully new cases will be solved by this PR: https://github.com/thijsvanloef/palworld-server-docker/pull/510

Still running into this issue since maybe a week or so ago. I’ve had to disable daily restart. Anytime I have to restart, I need to take a backup manually, restart, then restore. I think shutdown calls backup. It’s almost as if backup behavior has changed somehow that immediate shutdown after successful call to backup results in this.