LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

[Bug]: Docker Backups stores symlinks insead server files. Also backups folder is outside of persisted volume by default

Open Neimolon opened this issue 1 year ago • 1 comments

User story

As a user, I experienced error when I tried to use the backup tool. When I checked the backup tar file, it was suspiciously small. The content inside only keeps serverfile synlinks and none of the game data.

Game

PaperMC, but extensible to every docker

Linux distro

Ubuntu 22.04

Command

command: backup

Further information

As a user, I experienced error when I tried to use the backup tool. When I checker the backup tar file, it was suspiciously small. The content inside only keeps serverfile synlinks and none of the game data:

Tarball file content:

image

Original directory:

image

This behaviour can result on a catastrphic mess if you trust what this command is supposed to do.

There are many ways to get riddle of this. My quick fix was editing /app/lgsm/modules/command_backup.sh, and adding the "-h" param to tar, who make tar retieve the linked directories:

image

Additional Info:

/app/lgsm/ is not persisted into the docker volume folder so ....

  • this fix fill be lost in every deploy
  • /app/lgsm/backup is the default directory ... so neither will be persisted. It can and must be modified into configuration file to another location inside /data folder

Relevant log output

No response

Steps to reproduce

execute pmcserver backup inside a docker container and check the backup tar file... will find link to serverfile directory instead relevant data

you can add into your common.cfg something like ... backupdir="/data/backup"

image

Neimolon avatar Jan 12 '25 21:01 Neimolon

If you want your backups to be persistent you can just mount a volume to /app/lgsm/backup.

I've also just noticed that my docker backups were very small... the -h flag indeed fixes it, otherwise only the symlink to /data/serverfiles is backed up (which is useless outside of the container).

FeneralGeldmarschall avatar Apr 26 '25 19:04 FeneralGeldmarschall

I found this issue today and I wanted to add this error (FAIL), I don't know if is related:

docker exec -u linuxgsm pwserver ./pwserver backup
[ INFO ] Backup pwserver: Starting backup: No previous backups found
[ WARN ] Backup pwserver: pwserver will be restarted
[  OK  ] Stopping pwserver: Graceful: CTRL+c: 2 ... OK
[ FAIL ] Backup pwserver: Problem identifying the previous backup directory for exclusion.
[  OK  ] Backup pwserver: Completed: pwserver-2025-06-26-151952.tar.gz, total size 4.3M

luckyzor avatar Jun 26 '25 13:06 luckyzor