pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.66k stars 1.69k forks source link

Backups & archives fail on symlinked files (readlink: readlink alpine/bin/arch: no such file or directory) #2418

Closed VibeGAMESNL closed 3 years ago

VibeGAMESNL commented 4 years ago

Describe the bug When you create a backup of a FiveM server (using @parkervcp egg). You will get an error. This should be fixed in issue #2271 but it isn't fully fixed yet.

ERROR: [Sep 25 11:04:39.795] failed to generate backup for server error=error while generating server backup: read /var/lib/pterodactyl/volumes/a9433707-9022-4e2e-aacd-6bf4820b4b1f/alpine/usr/lib/icu/67.1: is a directory server=a9433707-9022-4e2e-aacd-6bf4820b4b1f

To Reproduce Steps to reproduce the behavior:

  1. Install a server with the Parker FiveM egg
  2. Create a backup
  3. Check de deamon (debug mode)

Expected behavior A successful backup created by the panel.

VibeGAMESNL commented 3 years ago

If you exclude the alpine folder, the backup will succeed but that shouldn't be needed.

DaneEveritt commented 3 years ago

@VibeGAMESNL can you reproduce this and include the full stacktrace not just the error line?

VibeGAMESNL commented 3 years ago

@DaneEveritt

ERROR: [Oct 26 14:07:42.124] failed to get archive for server error=walking /srv/daemon-data/8eded47d-5ae9-4c1a-b43c-3dae29f69980/alpine: /srv/daemon-data/8eded47d-5ae9-4c1a-b43c-3dae29f69980/alpine/bin/arch: writing: alpine/bin/arch: readlink: readlink alpine/bin/arch: no such file or directory server=8eded47d-5ae9-4c1a-b43c-3dae29f69980

Stacktrace:
github.com/apex/log.(*Entry).Error
        /home/runner/go/pkg/mod/github.com/apex/log@v1.8.0/entry.go:96
github.com/pterodactyl/wings/router.postServerArchive.func1
        /home/runner/work/wings/wings/router/router_transfer.go:98
runtime.goexit
        /opt/hostedtoolcache/go/1.15.2/x64/src/runtime/asm_amd64.s:1374
DaneEveritt commented 3 years ago

cc @matthewpi

alliraine commented 3 years ago

I also get a similar issue with .git folders.

ERROR: [Oct 28 15:55:52.349] failed to get archive for server error=walking /srv/daemon-data/e0513fa7-f9b5-44a9-8f5d-dc68b35fa07e/plugins: /srv/daemon-data/e0513fa7-f9b5-44a9-8f5d-dc68b35fa07e/plugins/.git/tXYOyaL: writing: plugins/.git$

Stacktrace: github.com/apex/log.(*Entry).Error /home/runner/go/pkg/mod/github.com/apex/log@v1.8.0/entry.go:96 github.com/pterodactyl/wings/router.postServerArchive.func1 /home/runner/work/wings/wings/router/router_transfer.go:98 runtime.goexit /opt/hostedtoolcache/go/1.15.2/x64/src/runtime/asm_amd64.s:1374

ERROR: [Oct 28 19:11:46.545] failed to get archive for server error=walking /srv/daemon-data/e0513fa7-f9b5-44a9-8f5d-dc68b35fa07e/plugins: /srv/daemon-data/e0513fa7-f9b5-44a9-8f5d-dc68b35fa07e/plugins/.git/tXYOyaL: writing: plugins/.git$

Stacktrace: github.com/apex/log.(*Entry).Error /home/runner/go/pkg/mod/github.com/apex/log@v1.8.0/entry.go:96 github.com/pterodactyl/wings/router.postServerArchive.func1 /home/runner/work/wings/wings/router/router_transfer.go:98 runtime.goexit /opt/hostedtoolcache/go/1.15.2/x64/src/runtime/asm_amd64.s:1374

matthewpi commented 3 years ago

For future note, the logic between backups and transfers are not shared. So if an error occurs while creating a backup it is completely different from if one occurs when transferring a server.

DaneEveritt commented 3 years ago

I'm a little baffled still, added some hopefully better error logging so next time it happens we should be able to get a more accurate stack trace.

matthewpi commented 3 years ago

This should be resolved with v1.2.0 which included a rewrite of the archiver which now should properly handle symlinks and ignore any symlink errors.

VibeGAMESNL commented 3 years ago

@matthewpi Issue still exist on server transfers.

matthewpi commented 3 years ago

@matthewpi Issue still exist on server transfers.

Transfers intentionally use different logic which will be switched over in the next release as long as backups are fine. I'd rather have transfers fail if anything could potentially break the server.