vinanrra / Docker-7DaysToDie

7 days to die server using LinuxGSM in Docker with backups, monitor, auto-installable mods and more
GNU General Public License v3.0
228 stars 45 forks source link

[BUG] Severs load incorrectly folder after backup #249

Closed vinanrra closed 3 months ago

vinanrra commented 3 months ago

Discussed in https://github.com/vinanrra/Docker-7DaysToDie/discussions/245

Originally posted by **captainlogan1** June 24, 2024 This only occurs for me directly after a 5AM backup, causing the server to appear to lose save game data since it is looking in the wrong location (`/home/ubuntu/...` as opposed to `/home/sdtdserver/...`) for our save game files. Searching the logs for `/home/` here are the matches from a 5am restart: ``` 29:Mono path[0] = '/home/sdtdserver/serverfiles/7DaysToDieServer_Data/Managed' 30:Mono config path = '/home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/etc' 40:Loading player data from /home/sdtdserver/serverfiles/7DaysToDieServer_Data/data.unity3d 41:PlayerPrefs - Creating folder: /home/ubuntu/.config/unity3d/The Fun Pimps 42:PlayerPrefs - Creating folder: /home/ubuntu/.config/unity3d/The Fun Pimps/7 Days To Die - Dedicated 45:[Subsystems] Discovering subsystems at path /home/sdtdserver/serverfiles/7DaysToDieServer_Data/UnitySubsystems 82:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x331cc40.so 83:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x37610e0.so 93:2024-06-22T05:04:55 0.468 INF Command line arguments: ./7DaysToDieServer.x86_64 -quit -batchmode -nographics -dedicated -configfile=/home/sdtdserver/serverfiles/sdtdserver.xml 94:2024-06-22T05:04:55 0.470 INF Parsing server configfile: /home/sdtdserver/serverfiles/sdtdserver.xml 133:2024-06-22T05:04:57 2.313 INF [MODS] Start loading from: '/home/sdtdserver/serverfiles/7DaysToDieServer_Data/../Mods' 151:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x43b8d80.so 152:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x43c91a0.so 606:GamePref.SaveGameFolder = /home/ubuntu/.local/share/7DaysToDie/Saves 653:GamePref.UserDataFolder = /home/ubuntu/.local/share/7DaysToDie 1045:2024-06-22T05:06:29 94.914 INF Started thread SaveChunks /home/ubuntu/.local/share/7DaysToDie/Saves/North Nuzaya County/MyGame/Region ``` Note the following: - `41:PlayerPrefs - Creating folder: /home/ubuntu/.config/unity3d/The Fun Pimps` - `606:GamePref.SaveGameFolder = /home/ubuntu/.local/share/7DaysToDie/Saves` - `653:GamePref.UserDataFolder = /home/ubuntu/.local/share/7DaysToDie` - `1045:2024-06-22T05:06:29 94.914 INF Started thread SaveChunks /home/ubuntu/.local/share/7DaysToDie/Saves/North Nuzaya County/MyGame/Region` - etc Simply restarting the container correctly uses `/home/sdtdserver/`, here is an example of "normal" logs: ``` 29:Mono path[0] = '/home/sdtdserver/serverfiles/7DaysToDieServer_Data/Managed' 30:Mono config path = '/home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/etc' 40:Loading player data from /home/sdtdserver/serverfiles/7DaysToDieServer_Data/data.unity3d 41:PlayerPrefs - Creating folder: /home/sdtdserver/.config/unity3d/The Fun Pimps 42:PlayerPrefs - Creating folder: /home/sdtdserver/.config/unity3d/The Fun Pimps/7 Days To Die - Dedicated 45:[Subsystems] Discovering subsystems at path /home/sdtdserver/serverfiles/7DaysToDieServer_Data/UnitySubsystems 82:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x3002320.so 83:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x350d570.so 93:2024-06-20T14:48:19 0.500 INF Command line arguments: ./7DaysToDieServer.x86_64 -quit -batchmode -nographics -dedicated -configfile=/home/sdtdserver/serverfiles/sdtdserver.xml 94:2024-06-20T14:48:19 0.502 INF Parsing server configfile: /home/sdtdserver/serverfiles/sdtdserver.xml 133:2024-06-20T14:48:20 1.585 INF [MODS] Start loading from: '/home/sdtdserver/serverfiles/7DaysToDieServer_Data/../Mods' 151:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x40b65f0.so 152:Fallback handler could not load library /home/sdtdserver/serverfiles/7DaysToDieServer_Data/MonoBleedingEdge/x86_64/data-0x40bae80.so 158:2024-06-20T14:48:20 1.663 INF Loading permissions file at '/home/sdtdserver/.local/share/7DaysToDie/Saves/serveradmin.xml' 589:GamePref.SaveGameFolder = /home/sdtdserver/.local/share/7DaysToDie/Saves 636:GamePref.UserDataFolder = /home/sdtdserver/.local/share/7DaysToDie ``` Note correct values for: - `41:PlayerPrefs - Creating folder: /home/sdtdserver/.config/unity3d/The Fun Pimps` - `589:GamePref.SaveGameFolder = /home/sdtdserver/.local/share/7DaysToDie/Saves` - etc Is this some LinuxGSM config that I am missing here? As you can see it uses `/home/sdtdserver` in both cases, it's just for some paths it will use `/home/ubuntu` **ONLY** after a 5am backup. It seems to be some type of default otherwise it's grabbing incorrect path info for some reason. None of my configs use `/home/ubuntu/...` nor am I attaching any volumes like that to the docker. I see `UserDataFolder` and `SaveGameFolder` properties in the serverconfig xml, but I don't understand why it would need that since it properly finds the default locations 99% of the time with the exception of 5am backups. Thanks in advance for any help with this!
vinanrra commented 3 months ago

@dgolveira @captainlogan1

I was able to reproduce the issue it's going to be fixed by changing how it's done the backup if you could test it the new image

vinanrra/7dtd-server:test

vinanrra commented 3 months ago

I will have my server running this version if it's working as expected I will upload the changes

dgolveira commented 3 months ago

@dgolveira @captainlogan1

I was able to reproduce the issue it's going to be fixed by changing how it's done the backup if you could test it the new image

vinanrra/7dtd-server:test

Ok, i will test. Tanks.

captainlogan1 commented 3 months ago

@dgolveira @captainlogan1

I was able to reproduce the issue it's going to be fixed by changing how it's done the backup if you could test it the new image

vinanrra/7dtd-server:test

Nice, looks like this will reduce the large size too. Two birds with one stone :satisfied:

vinanrra commented 3 months ago

250

vinanrra commented 3 months ago

I found the issue, the crontab it's being executed with the user ubuntu instead of the sdtdserver, I will check how I can fix this, this issue it's because of the switch to Ubuntu 24, it wasn't at 22

vinanrra commented 3 months ago

Pushed a new update that MAYBE fix the issue, also added an option to select the hour when you want to start the backup and maximum backups that you want to keep it.

dgolveira commented 3 months ago

Pushed a new update that MAYBE fix the issue, also added an option to select the hour when you want to start the backup and maximum backups that you want to keep it.

Did you update vinanrra/7dtd-server:test? because from yesterday to today this version had the same problem

vinanrra commented 3 months ago

Hi @dgolveira it seems that you aren't used the latest version, I have pushed today another version and I have added the possibility to choose the time when you want to do the backup, and also it seems to have fixed the issue.

image image

vinanrra commented 3 months ago

Fixed at v0.7.6