Closed leonardwohl closed 4 months ago
@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
You're the man!! It works!
@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
I tried your method and added this fix to the. yml file, but it didn't seem to work. I'm confused about why
@suiyu4073 logs for the save_repair container?
@suiyu4073save_repair 容器的日志?
@suiyu4073 logs for the save_repair container?
logs :
---
PalWorldSaveRepair v0.1.1 2024-02-18 dd5f298
https://github.com/YDKK/palworld-save-repair
---
failed to read dir: ./palworld/Pal/Saved/SaveGames/0/F1D09C3D4CE54F4CAA905CEAC4DBBF4A/Players
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
environment:
PUID: 1000
PGID: 1000
PORT: 8211 # Optional but recommended
PLAYERS: 16 # Optional but recommended
MULTITHREADING: true
RCON_ENABLED: true
RCON_PORT: 25575
TZ: "UTC"
ADMIN_PASSWORD: "adminPasswordHere"
COMMUNITY: false # Enable this if you want your server to show up in the community servers tab, USE WITH SERVER_PASSWORD!
SERVER_NAME: "palworld-server-docker by Thijs van Loef"
SERVER_DESCRIPTION: "palworld-server-docker by Thijs van Loef"
volumes:
- ./palworld:/palworld/
save-repair:
image: ydkk/palworld-save-repair:latest
volumes:
- ./palworld:/palworld/
environment:
- PLAYERS_SAVE_PATH=./palworld/Pal/Saved/SaveGames/0/F1D09C3D4CE54F4CAA905CEAC4DBBF4A/Players
entrypoint: ""
# check and repair save data every 1 hour
command: ["/bin/sh", "-c", "while true; do sleep 3600; /app/pal_world_save_repair; done"]
restart: unless-stopped
I can't read this folder whether I set the - PLAYERSSAVE-PATH=in the form of "./" or "/" here.
My absolute path is set to:
~/palworld_server/palworld/Pal/Saved/SaveGames/0/F1D09C3D4CE54F4CAA905CEAC4DBBF4A/Players
I don't know how to solve this problem, is it related to file read permissions?
@suiyu4073 You're mounting ./palworld
to /palworld
so it should be PLAYERS_SAVE_PATH=/palworld/Pal/Saved/SaveGames/0/F1D09C3D4CE54F4CAA905CEAC4DBBF4A/Players
. Make sure both containers are running with the same permissions, maybe try setting the same PUID
and PGID
in each?
I also faced the same issue, so whenever errors occurred, I restored the backup. It was cumbersome because I need to shut down the server using commands in the game and restart or update docker. But thankfully now, having a repair tool is a relief.
Hello,
I have the exact same issue. I saved my Character save files at different points and compared them. It seems that the server stop (and possibly the /save command) have a problem which overwrites the value of "save_game_class_name" from "/Script/Pal.PalWorldPlayerSaveGame" to "None.PalWorldPlayerSaveGame".
Unfortunately I have a problem with the suggested workaround with this "save_file_repair" as every time I execute it and the files get repaired my character has no equipment, I can't interact with anything and can't even open the menu.
Edit: The shutdown Server does a "rcon save":
save_server() {
local return_val=0
if ! RCON save; then
return_val=1
fi
return "$return_val"
}
# Saves then shutdowns the server
# Returns 0 if it is shutdown
# Returns 1 if it is not able to be shutdown
shutdown_server() {
local return_val=0
# Do not shutdown if not able to save
if save_server; then
if ! RCON "DoExit"; then
return_val=1
fi
else
return_val=1
fi
return "$return_val"
}
I would suspect an error there, would be good to know what the "rcon save" actually does. According to the documentation it does the following: "Save the world data to disk. Useful to ensure your Pal, player, and other data is saved before stopping the server or performing a risky gameplay option." Not sure what it does exactly, but if it is only the player saves, this could be done manually maybe?
As of 1.5 I have the same issue with equipment, I suspect the repair tool might not be compatible with the latest game version. Planning to investigate over the weekend.
@suiyu4073 You're mounting
./palworld
to/palworld
so it should bePLAYERS_SAVE_PATH=/palworld/Pal/Saved/SaveGames/0/F1D09C3D4CE54F4CAA905CEAC4DBBF4A/Players
. Make sure both containers are running with the same permissions, maybe try setting the samePUID
andPGID
in each?
Thank you for your help. I have resolved the issue and do not need to set the same PID. You just need to pull it again and restart it
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.
Hey @MattDavies, Thanks for investigating and providing a solution. I'm definitely still seeing save_game_class_name
set to None.xxx
from time to time. I can certainly repair with cheahjs' save tools, but am wondering if your save repair is still working automatically in docker in v1.5.1. Thoughts?
Hopefully new cases will be solved by this PR: https://github.com/thijsvanloef/palworld-server-docker/pull/510
Hey @thijsvanloef, I saw that just committed the change. Does the docker image get updated automatically at every start/reboot?
Hey @thijsvanloef, I saw that just committed the change. Does the docker image get updated automatically at every start/reboot?
https://palworld-server-docker.loef.dev/guides/update-the-container 😄
Hey @thijsvanloef, I saw that just committed the change. Does the docker image get updated automatically at every start/reboot?
https://palworld-server-docker.loef.dev/guides/update-the-container 😄
Thanks. I did docker-compose down and up. How do I check if the container is running latest version of the help script (i.e. Shutdown instead of DoExit)?
By the way, in the doc link you sent, it should be docker-compose
, not docker compose
.
@porochickenrye If a pull has taken place once you start the docker-compose.yml you should probably be fine. You can test it by shutting down the server while you are in-game and seeing if a shutdown message is sent.
As for the docs, it should be docker compose
, docker-compose
is Compose V1 and deprecated since jul 2023 https://docs.docker.com/compose/migrate/
Thanks @thijsvanloef on the docker compose migration note.
I have tested restarting the server many times but never seen an in-game shutdown message. I do get discord messages since I have those enabled.
Sending Discord json: {"embeds":[{"title":"Shutdown","description":"Server is shutting down...","color":15258703}]}
Complete Save
Shutdown...
cli: execute: rcon: read packet size: EOF
Player 1 has left
cli: execute: auth: rcon: dial tcp 127.0.0.1:25575: connect: connection refused
Shutdown handler: cleanup.
Sending Discord json: {"embeds":[{"title":"Stop","description":"Server has been stopped!","color":14614528}]}
The version is see in the logs is 2815085007637542021 but I'm sure if that's the game version or the docker image version.
$ docker logs -f palworld-server
****EXECUTING USERMOD****
usermod: no changes
****Checking for new update****
Current Version: 2815085007637542021
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****
Update: I'm sure I'm running the latest image as I tried deploying a new contain from scratch. However, I still saw a corrupted save yesterday when I spun down use docker compose. Let me what logs I can provide.
@porochickenrye Do you still experience corrupted save files at restart with 0.35.1?
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:
docker-compose down && docker-compose up -d
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
Player data for those two characters is corrupted and has to be restored from backup.
OS information
Hardware information
docker-compose.yml contents
Container/Host Logs
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.