mmmaxwwwell / space-engineers-dedicated-docker-linux

Space Engineers Dedicated Server running in Docker for Linux
MIT License
175 stars 42 forks source link

Backups not working #45

Closed Lloldrin closed 4 months ago

Lloldrin commented 2 years ago

We have recently started playing using this image. The first two days went fine, but after a server reset (manual, had to do a rollback), the backups stopped being created. The logs say that the server was autosaving every 20 minutes, but when it reset again (automatically), it was empty, and the last backup was the day before.

Is this a known issue or did I break something when I reset the world manually?

When resetting manually: I deleted SANDBOX_0_0_0.sbsB5, Sandbox.sbc, and Pertam.vx2. Then I copied back a clean version of Pertam.vx2 and ran the start-script

mmmaxwwwell commented 2 years ago

Sandbox.sbc contains persisted save data, removing that would reset part of the world to it's initial state. I'm not sure about the vx2 files, and the sbsB5 files store modifications to the asteroids/planet voxels. Cleaning up those intermittently will improve server performance.

Lloldrin commented 2 years ago

Yeah, the initial reset worked fine, but after that it stopped acually autosaving. The logs said "Autosaving" every 20 minutes, but nothing was actually written to /config/World/Backup/

mmmaxwwwell commented 2 years ago

Try replacing sandbox.sbc, otherwise its probably a permissions issue. I've had reports of it failing silently when it can't save.

SeBL4RD commented 2 years ago

I have the same problem, the server does not save at all. I created my own cfg locally (and save), I imported the parameters from the base one (the Z directories and others). The server works, our password parameters, the number of slots are functional, the automatic saves are done (on the console), but the server does not save. Our files have not been modified since their creation. Is it a permission problem? I used Root in sftp to upload my world and cfg. Should I do some manipulation? Docker not using Root?

mmmaxwwwell commented 2 years ago

Sounds like a permissions problem to me

mmmaxwwwell commented 2 years ago

Check the owning user, group and permissions of the world folder

SeBL4RD commented 2 years ago

All files are owned by Root user. isn't that supposed to be the case?

mmmaxwwwell commented 2 years ago

So docker runs as the root user, but the server inside the container runs as uid 1000

mmmaxwwwell commented 2 years ago

So no, the world directory should be writable by uid 1000

SeBL4RD commented 2 years ago

Do you know a command to change the entire directory to uid 1000 rather than root?

SeBL4RD commented 2 years ago

This part of your script is not supposed to do it at each start? if [ "$(stat -c '%u' appdata)" != "1000" ]; then echo "Setting owner of appdata to UID 1000" sudo chown -R 1000:1000 appdata fi

SeBL4RD commented 2 years ago

Fixed, it was actually because of that. I chown -R 1000:1000 World and that fixed the problem. It would be necessary to add to the script the automation of the rights of this folder and its files.

SeBL4RD commented 2 years ago

if [ "$(stat -c '%u' /root/space-engineers-dedicated-docker-linux/appdata/space-engineers/config/World)" != "1000" ]; then echo "Setting owner of World to UID 1000 sudo chown -R 1000:1000 /root/space-engineers-dedicated-docker-linux/appdata/space-engineers/config/World fi

Something like this i suppose :)

mmmaxwwwell commented 4 months ago

Thank you for posting a followup with your solution