lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.94k stars 272 forks source link

Valheim world resumes from fresh world seed. #45

Closed PrybarBas closed 3 years ago

PrybarBas commented 3 years ago

After about 5 hours the docker server developed odd network connectivity issues and we were forced to stop it and restart it. Things didn't go as expected as the correct world seed was loaded, but instead we loaded into a fresh world seed (new game).

Checking the world data folder, it contained. world.db world.db.backup world.fwl

The world.db was around 150kb, and the .backup was around 30mb. Backup files held the same files structure and contained a world.db and a .backup version.

Since I had backups, I removed the world.db and renamed the backup one. to just .db. This restored the server. Exact same issue occurred with roll back to older versions.

Valheim is early access, I'm a n00b with Docker image experience, those two are combined are prone to cause issues. Leaving me with the question: Did I mess up the server configuration? Did I stumble upon a docker bug? Or is this an issues with Valheim game server...

Groostav commented 3 years ago

yeah so this sounds like a docker thing. Are you familiar with docker volumes, and how docker persists files?

Unless you explicitly tell docker to persist files (namely the world file), docker will not persist them.

For this image you need to explictly persist the /config/ folder, where this image keeps its world files.

lloesche commented 3 years ago

I concur with @Groostav, from your description it sounds like the /config directory is not a volume mount. Although if that was the case I wonder where the backups came from. Can you share details about your current configuration?

PrybarBas commented 3 years ago

I've goofed up with troubleshooting 101 and forgot to do the most common thing to see if after resorting the world, if I could replicate the issues with a server stop / start action. Was a bit in panic mode last night, for the game time of about 8 player done over the course of those 4 or 5 hours felt at risk. The unexpected responsibility that landed on my shoulders caught me off guard...

Anyways, a stop and start action confirmed it once more that the world now resumes correctly and there is no existence of a world.db.backup within the world folder of the recent created backups to be found.

For ease of mind, I'll share my setup to hopefully uncover a configuration flaw on my part that could be corrected and allow me to sleep at night ;)

When installing docker on my Synology NAS a Docker volume was created and I blindly assumed this is were you create subfolders in for your docker images to work from data that should be retained and likely previous experimented docker images might have instructed me to do so. My Pi-Hole has been up 'n running for years now and can't recall it had issues after a docker stop/start action or a NAS reboot.

I guess images might work better than me trying to explain something I'm not too tech savvy with, I typical follow the instructions, given there detailed enough to not conflict with what I'm seeing.

image

image Each folder has his own set of data, that I don't believe conflict. The backup folder contains only the data from the world folder in a handy zip file.

And the server logs, kind of line up with the activity I've seen passing by on the batch file when I ran the sever dedicated from my windows system and nothing has grabbed my eye during booting up of the sever that might indicate there is a issues. I'm not certain if these server activity logs were saved for me to go back through to compare.

The only thing I'm rather certain off, is that the backup actions are new to me to see in the server activity logs. For no hourly backups were made on my server that I'm aware off and if so, I'm not certain where they were stored.

I appreciate help,

lloesche commented 3 years ago

The configuration looks good. Since you are using the same subdirectory names it would suffice to only volume mount docker/Valheim Server/valheim-server-config to /config. If bandwidth/startup time is a concern you can also mount something like /docker/Valheim Server/valheim-server-download to /opt/valheim_dl so the container does not have to re-download the 1 GB server from Steam on each fresh start.

Now regarding backup location. Since you're on a Synology the first thing I would make sure is that you have the latest container image downloaded. On a standard Linux System when you do a docker run containername:latest it will check if you have the latest container and if not it will download it. On Synology you have to specifically tell it to check for new versions. So that is what I would do, since backups came in a later version of the container.

I added a section with screenshots at https://github.com/lloesche/valheim-server-docker#updating-the-container-image-to-the-latest-version

But like the instructions say, make sure that you have a backup of your /config/worlds directory.

PrybarBas commented 3 years ago

I've double checked my folder/volume settings and upon clearing another test setup, my folder and file date remains and didn't get wiped, so I'm assume I'm safe and Synolgy might have 'volatile' folders of the docker images, safely hidden away from your not to tech savvy folks.

I've no issues with bandwidth or startup time issues, but thanks for the awareness, I'll keep it in mind with one of my bigger docker images.

On a side note; a recent update got rolled out and seeing similar post pop up on the steam forums, reporting there worlds resetting back to a new game state and mentioning of am additional world.db.backup file present in there worlds folder. So possibly a Valheim early access issue.

Anyways, I very much appreciate the help, along with additional instructions for others to read in the install guide.