thijsvanloef / palworld-server-docker

A Docker Container to easily run a Palworld dedicated server.
https://hub.docker.com/r/thijsvanloef/palworld-server-docker
MIT License
2.42k stars 295 forks source link

Synology issues #35

Closed fynaltgn closed 5 months ago

fynaltgn commented 7 months ago

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

I use like this.

docker run -d \ --name palworld-eklipc \ -p 8211:8211/udp \ -p 27015:27015/udp \ -v /volume1/docker/palworld:/palworld/ \ -e PLAYERS=16 \ -e PORT=8211 \ -e PUID=1000 \ -e PGID=1000 \ -e COMMUNITY=false \ thijsvanloef/palworld-server-docker

When I run it, I need to restart the dsm.

And that's why I removed reboot all the time because otherwise the dsm will let me dumb.

Desktop (please complete the following information):

docker-compose.yml contents

Container/Host Logs

WARNING: Error loading config file: .dockercfg: $HOME is not defined 1dea44f8d29e0c518a84720ecf069151e4836f41460506cd36e8b7878a598db8

Additional context

TheKogoro commented 6 months ago

In portainer, what network is the server one? ("bridge" or "palworld_default_network") or something like that - make sure that the network is also "allowed" in your NAS firewall ... Eitherwise, I'm out of suggestions on why you're port remains closed - but that's the issue, I think. If you can get the port open, others will be able to connect.

I dont know if i can set much in NAS firewall, is on "Allow all" with somes rules that Deny only selected service on a list, so normally it wont "refuse" but i never set up a game server ^^

Here is the network:

network 2 network1

I also tested a thing, i have put the Palworld server on the same network that manage Deluge and Waultwarden but it didnt change nothing, always not acessible from internet (Always work on local even on the bridge network used for other container)

@zapoqx how do you changed the "public" port value and where to do that ? you just put in the router that "the port you chose" redirect on 8211 on the server ? (Entry port: 12500 ---> Destination port : 8211). if it's that, i tested and port say always closed.

EDIT:

I also scanned ports from the local network of the NAS server, the ports of Palworld wont appears even on LAN, so how did i can connect to it if the port is not oppened even in local network ? that's odd

TheKogoro commented 6 months ago

Ok, i have found how to make working, i put a totally random port that i have openned on my Router and set on the "Stacks" configuration:

 ports:
        - 25650:8211/udp
        - 27015:27015/udp

Oddly, the port is noticed as "Closed" if i test with online tools that you put in link (in local network it say that is not open too) but i can sucefully join the server ^^. But didnt work if tried external with 8211 (possibly it's a restriction by docker/nas because somes docker app use a port range that is located in 8000).

For testing i connected my computer on phone sharing networn that is on 4G only.

Thanks for the help at all. (It's odd that port is recognized as closed but it worked fine ^^)

reedickulus commented 6 months ago

Glad to hear it's working. @zapoqx mentioned that some ISPs block 8211, so that might be it?

Some port checkers are better than others (I too had inconsistent results depending on the site I used). If it's not broke, let's not go chasing a fix... but glad to hear this fixed it

TheKogoro commented 6 months ago

I also have a 2 questions:

i have add somes settings in the server, somes for making backup (BACKUP_ON_STOP=True). When i stop the container, i didnt see any save created in the folder "backups" un the server folder "palworld-server" did anything wrong or Backup goes on an other folder ? (the server show that in logs:)

Complete Save

Shutdown...

did i need add a other path in volume settings for backup (if yes, what i need to put)

The other is, i have a weird lags, stuttering when i aim when i am on a mount (It seem doing that only when i am on a mount, if i aim when just walking, no problem). I have not this stutter/lags on aiming when on mount on my local game (no server, solo playing).

Here is the Vidéo: https://streamable.com/8083f5

zapoqx commented 6 months ago

First, many scanners will not check UDP protocols. Only TCP. Some that do scan UDP have different results depending on how it checks. Some routers can look at it as an attack and block it as well.

Second, to your question, did you make a custom cronjob for it? I don't see a "BACKUP_ON_STOP" value. The backup folder is in the same folder for the game volume.

At least on the NAS, what I did is made a task that I can quick trigger if I need to make a backup to the docker in question. But generally, I set a daily task to do a backup each day in the early hours of the morning since I have a backup done every few days to my offsite (so yes, I have a backup of the backup).

Its a weird question to ask but is the weird lag happening if you do a solo play? Like just playing within the game solo instead of with a server?

It is important to check that before asking if the lag is related to a server.

TheKogoro commented 6 months ago

First, many scanners will not check UDP protocols. Only TCP. Some that do scan UDP have different results depending on how it checks. Some routers can look at it as an attack and block it as well.

Second, to your question, did you make a custom cronjob for it? I don't see a "BACKUP_ON_STOP" value. The backup folder is in the same folder for the game volume.

At least on the NAS, what I did is made a task that I can quick trigger if I need to make a backup to the docker in question. But generally, I set a daily task to do a backup each day in the early hours of the morning since I have a backup done every few days to my offsite (so yes, I have a backup of the backup).

Its a weird question to ask but is the weird lag happening if you do a solo play? Like just playing within the game solo instead of with a server?

It is important to check that before asking if the lag is related to a server.

Hello,

For internet, i also added a rules on my router : Port 8211 out to 25650 (And in the server settings 25650 go to 8211) i do that because it always have :8211 when you go put the server ip in the game ^^ so it make both port will working.

for the Backups, i have added somes settings lines after resolved the internet problem . Actually, i have do a Internal save task on the Asustor NAS that just copy the whole folder "palworld-server" to a other location everyday with "skip files if no change" so it will save anyway ^^

New config:

version: "3.9"
services:
   palworld:
      image: thijsvanloef/palworld-server-docker:latest # Use :latest-arm64 tag instead of :latest for arm64 NAS
      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:
        - 25650:8211/udp
        - 27015:27015/udp
      environment:
        - PUID=1002
        - PGID=1000
        - PORT=8211
        - PLAYERS=6
        - SERVER_PASSWORD=PASSWORDIPUT
        - MULTITHREADING=true
        - RCON_ENABLED=true
        - RCON_PORT=25575
        - TZ=Europe/Zurich
        - ADMIN_PASSWORD=PASSWORDIPUT # You can secure the access to a server by using the admin password.
        - COMMUNITY=false  # Enable this with true if you want your server to show up in the community servers tab, USE WITH SERVER_PASSWORD above.
        - SERVER_NAME=Kogoro Server
        - SERVER_DESCRIPTION=Serveur Palworld de Kogoro (Heberge sur NAS)
        - UPDATE_ON_BOOT=True
        - BACKUP_ON_STOP=True
        - ZIP_BACKUPS=True
        - RETAIN_BACKUPS=
        - SCHEDULED_BACKUP=True
        - BACKUP_BEFORE_UPDATE=True
        - BACKUP_CRON=0 6 * * *
        - SCHEDULED_UPDATE=False
        - SCHEDULED_RESTART=True
        - BACKUP_ON_SCHEDULED_RESTART=False
        - RESTART_CRON=0 4 * * *

        - DIFFICULTY=None
        - DAYTIME_SPEEDRATE=1.000000
        - NIGHTTIME_SPEEDRATE=1.000000
        - EXP_RATE=1.300000
        - PAL_CAPTURE_RATE=2.000000
        - PAL_SPAWN_NUM_RATE=1.000000
        - PAL_DAMAGE_RATE_ATTACK=1.000000
        - PAL_DAMAGE_RATE_DEFENSE=1.000000
        - PLAYER_DAMAGE_RATE_ATTACK=1.500000
        - PLAYER_DAMAGE_RATE_DEFENSE=0.700000
        - 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=0.000000
        - COLLECTION_DROP_RATE=2.000000
        - COLLECTION_OBJECT_HP_RATE=1.000000
        - COLLECTION_OBJECT_RESPAWN_SPEED_RATE=1.000000
        - ENEMY_DROP_ITEM_RATE=2.000000
        - DEATH_PENALTY=None
        - ENABLE_PLAYER_TO_PLAYER_DAMAGE=False
        - ENABLE_FRIENDLY_FIRE=False
        - ENABLE_INVADER_ENEMY=True
        - ACTIVE_UNKO=True
        - ENABLE_AIM_ASSIST_PAD=True
        - ENABLE_AIM_ASSIST_KEYBOARD=False
        - DROP_ITEM_MAX_NUM=4079
        - DROP_ITEM_MAX_NUM_UNKO=100
        - BASE_CAMP_MAX_NUM=128
        - BASE_CAMP_WORKER_MAX_NUM=20
        - 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=0.50000
        - WORK_SPEED_RATE=1.000000
        - IS_MULTIPLAY=True
        - IS_PVP=False
        - CAN_PICKUP_OTHER_GUILD_DEATH_PENALTY_DROP=False
        - ENABLE_NON_LOGIN_PENALTY=False
        - 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

      volumes:
         - /volume1/Docker/palworld-server:/palworld

For the Lags/Stutter bug, i get than only when playing on the server, when i play solo i didnt have any problems.

EDIT: For the bug/lags, i play also on an other server that working with a strong machine on windows, i get exactly the same problem and the admin of the server too, so i dont think it's "this" server that cause the problem.

TheKogoro commented 5 months ago

I Always have backup Not working (or If it's working , it Make the backup in a folder that i doesnt See or have acces.) The backup folder in the Palworld folder is Always empty. I do a save everyday of the Palworld folder of the Server from the nas Save system because i didnt now If internat save of the Server is working and where the data is going (If it do a save)

zapoqx commented 5 months ago

I Always have backup Not working (or If it's working , it Make the backup in a folder that i doesnt See or have acces.) The backup folder in the Palworld folder is Always empty. I do a save everyday of the Palworld folder of the Server from the nas Save system because i didnt now If internat save of the Server is working and where the data is going (If it do a save)

It should be in the same folder (palworld-server in your case), but while I'm sure I should be using the cronjob backup, I do not use that. Instead, I use the task schedule to do docker execute to the palworld server docker and run the command "backup" each night and send me the notification in an e-mail for the task to complete. It even adds the terminal result (which includes the backup and the save location).

TheKogoro commented 5 months ago

I Always have backup Not working (or If it's working , it Make the backup in a folder that i doesnt See or have acces.) The backup folder in the Palworld folder is Always empty. I do a save everyday of the Palworld folder of the Server from the nas Save system because i didnt now If internat save of the Server is working and where the data is going (If it do a save)

It should be in the same folder (palworld-server in your case), but while I'm sure I should be using the cronjob backup, I do not use that. Instead, I use the task schedule to do docker execute to the palworld server docker and run the command "backup" each night and send me the notification in an e-mail for the task to complete. It even adds the terminal result (which includes the backup and the save location).

I dont get Anny backup or files backup on the Palworld Server folder (i have a backup folder but it's Always empty). Instead i using the internal folder save from the NAS because i relly dont know If thé Server really do any save even If the config say Yes because i was unnable to find any save data (backups) in the Palworld Server folder. Screenshot_20240323-170921

I think this method will also working, it copy the whole Server folder to save location. It dors that every night.

It Is possible to add a line in the config that Specify a folder for the save ? If Yes i can Try put a line that will force backup to go to a dedicated folder and watch If backup is proprely created. That will elimitate a problem that, possible the Server put backup in a system folder of docker that i dont have acces exept in SSH.

zapoqx commented 5 months ago

I think this method will also working, it copy the whole Server folder to save location. It dors that every night.

First, try this in synology task schedule docker exec palworld-server backup

Change "palworld-server" to the name of your palworld docker server if it isn't named exactly that.

Of course, have it send an e-mail notification to you so you can see results. It will tell you the terminal. Example:

Task: Backup Palworld
Start time: Sat, 23 Mar 2024 04:00:01 -0700
Stop time: Sat, 23 Mar 2024 04:00:03 -0700
Current status: 0 (Normal)
Standard output/error:
Complete Save
 [1;36m****Creating backup**** [0m
 [0;37mBackup created at /palworld/backups/palworld-save-2024-03-23_04-00-01.tar.gz [0m

If the backup errors, it will show it right then and there.

TheKogoro commented 5 months ago

I think this method will also working, it copy the whole Server folder to save location. It dors that every night.

First, try this in synology task schedule docker exec palworld-server backup

Change "palworld-server" to the name of your palworld docker server if it isn't named exactly that.

Of course, have it send an e-mail notification to you so you can see results. It will tell you the terminal. Example:

Task: Backup Palworld
Start time: Sat, 23 Mar 2024 04:00:01 -0700
Stop time: Sat, 23 Mar 2024 04:00:03 -0700
Current status: 0 (Normal)
Standard output/error:
Complete Save
 [1;36m****Creating backup**** [0m
 [0;37mBackup created at /palworld/backups/palworld-save-2024-03-23_04-00-01.tar.gz [0m

If the backup errors, it will show it right then and there.

I using an Asustor NAS, is very similar to synology but i didnt have Sames fonctions. I didnt know where to run that, the only sheedule settings i found is for basic settings . It Is possible to put this command in SSH ? Just for Try and See If backup is Make proprely.

zapoqx commented 5 months ago

I using an Asustor NAS, is very similar to synology but i didnt have Sames fonctions. I didnt know where to run that, the only sheedule settings i found is for basic settings . It Is possible to put this command in SSH ? Just for Try and See If backup is Make proprely.

You can use SSH, but not sure if the instructions are similar. Though that said, that means the issue you are facing isn't related to synology.

That said, the only hint I'd give in this case is install Portainer community edition as it comes with a terminal for each docker so you can just run the command. With this, you would not only see if "backup" can run, but also "rcon-cli" if you use it because it can tell alot more. If rcon-cli is broken after an update, it is usually known because an error may be said on startup, but when using the console for the docker, if rcon-cli fails to start, then you have more issues at hand (unless it is actually broken for whatever reason).

TheKogoro commented 5 months ago

I using an Asustor NAS, is very similar to synology but i didnt have Sames fonctions. I didnt know where to run that, the only sheedule settings i found is for basic settings . It Is possible to put this command in SSH ? Just for Try and See If backup is Make proprely.

You can use SSH, but not sure if the instructions are similar. Though that said, that means the issue you are facing isn't related to synology.

That said, the only hint I'd give in this case is install Portainer community edition as it comes with a terminal for each docker so you can just run the command. With this, you would not only see if "backup" can run, but also "rcon-cli" if you use it because it can tell alot more. If rcon-cli is broken after an update, it is usually known because an error may be said on startup, but when using the console for the docker, if rcon-cli fails to start, then you have more issues at hand (unless it is actually broken for whatever reason).

Hello, i have Portainer but i was unable to execute commands , i get this: I dont know how i need to make the propper command to make this working, i am not a linux guy. Capture

i tried with rcon-cli to run a shutdown and "Save" but it just say "Save is done" but i think it only save the actual game and not making backup. i doesnt found how to make launch a backup .

I also tried to use "Custom command button" where is the console and put "docker exec palworld-server backup" but it does nothing, just a black box blink and nothing happen. (sorry to be noob X) and thanks for the help, i appreciate )

OK, in the terminal i just need to put "Backup" and it worked:

Capture

But note that when i order a shutdown, it only do a save, no any Backup even if "- BACKUP_ON_STOP=true" is on the settings.

zapoqx commented 5 months ago

Yea, the save system is saved to the instance that is running for the game with its ID. Backup exports all of the files associated in there and the folder ID it is in. So it is working, the cronjob automatic is just failing to do so. Yea, when you use portainer to connect to the terminal, you have to ignore using "docker" commands because you're already in that docker instance so commands will work out the gate the way they are meant to. So to me, you will need to either figure out a fix with the cron job or you may need to figure out how to get your asus nas to run a schedule command to run the backup manually.

TheKogoro commented 5 months ago

Yea, the save system is saved to the instance that is running for the game with its ID. Backup exports all of the files associated in there and the folder ID it is in. So it is working, the cronjob automatic is just failing to do so. Yea, when you use portainer to connect to the terminal, you have to ignore using "docker" commands because you're already in that docker instance so commands will work out the gate the way they are meant to. So to me, you will need to either figure out a fix with the cron job or you may need to figure out how to get your asus nas to run a schedule command to run the backup manually.

I was able to make it working now, i get this in the logs:


time="2024-03-24T00:00:00+01:00" level=info msg=starting iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 0 * * *"

time="2024-03-24T00:00:00+01:00" level=info msg="Complete Save" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 0 * * *"

time="2024-03-24T00:00:00+01:00" level=info msg="\x1b[1;36m****Creating backup****\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 0 * * *"

time="2024-03-24T00:00:00+01:00" level=info msg="\x1b[0;37mBackup created at /palworld/backups/palworld-save-2024-03-24_00-00-00.tar.gz\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 0 * * *"

time="2024-03-24T00:00:00+01:00" level=info msg="\x1b[1;36m****Removing Old Backups****\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 0 * * *"

time="2024-03-24T00:00:00+01:00" level=info msg="\x1b[0;37mRemoving backups older than 10 days\x1b[0m" channel=stdout iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 0 * * *"

time="2024-03-24T00:00:00+01:00" level=info msg="job succeeded" iteration=0 job.command="bash /usr/local/bin/backup" job.position=0 job.schedule="0 0 * * *"

It seem work because has created a new save in the savedata folder dated as midnight. the problem seem to be a space or a bad character in the line that make the job ^^' simple mistake but never checked that.

thijsvanloef commented 5 months ago

This issue has been opened quite some time ago and this thread has slowly become a troubleshooting discussion instead of a single issue, are you folks ok with it if I convert this issue into a discussion?

TheKogoro commented 5 months ago

This issue has been opened quite some time ago and this thread has slowly become a troubleshooting discussion instead of a single issue, are you folks ok with it if I convert this issue into a discussion?

Yeah, i think it's a good idea so people having little problems or need sommes help (like me x) ) dont need to open a ticket for that :) .