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.56k stars 1.64k forks source link

Unable to delete failed S3 backups #4522

Closed hexandcube closed 1 year ago

hexandcube commented 1 year ago

Current Behavior

When creating an S3 backup with an incorrect configuration, the backup will fail. Attempting to delete this failed backup results in an error: An unexpected error was encountered while processing this request, please try again.

image image

Expected Behavior

The failed backup should disappear from the list of backups.

Steps to Reproduce

  1. Configure S3 backups incorrectly (e.g. by using an incorrect endpoint)
  2. Create a backup
  3. Wait until the backup fails
  4. Attempt to delete the fail backup

Panel Version

1.10.4

Wings Version

1.7.2

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

Wings Logs: https://ptero.co/evyfyrebuk (I don't see anything related to deleting the backup here) Panel Logs: https://bin.ptdl.co/irvhq/ Additional logs from /var/www/pterodactyl/storage/logs/laravel-$(date +%F).log:

[2022-11-04 19:01:47] production.ERROR: The path of a URI with an authority must start with a slash "/" or be empty {"userId":1,"exception":"[object] (GuzzleHttp\\Psr7\\Exception\\MalformedUriException(code: 0): The path of a URI with an authority must start with a slash \"/\" or be empty at /var/www/pterodactyl/vendor/guzzlehttp/psr7/src/Uri.php:735)

Is there an existing issue for this?

DaneEveritt commented 1 year ago

@hexandcube can you please pull more logs from the Panel? Both that you've provided here are missing critical context that makes this issue easier to track down. The first linked one is missing the first part of the stack and the actual error, the second one is missing the entire stack trace.

Should be able to just pull the last few hundred lines from the Panel logs and that'll be sufficient. :)

hexandcube commented 1 year ago

Oops, sorry. Here:

/var/log/pterodactyl/wings.log: https://ptero.co/ofejasocoj.log Last 150 lines of /var/www/pterodactyl/storage/logs/laravel-$(date +%F).log: https://ptero.co/qulotokafa.log

Please let me know if you need anything else

matthewpi commented 1 year ago

Ah. This makes a lot of sense. If your S3 endpoint is incorrect, no wonder why the backup won't delete. We send a Delete request regardless of the failure state and only ignore 404 errors, not just all exceptions. If you fix the settings in your .env the backup should get deleted properly.

I'm not sure if there is much we can do here other than just validating the settings. Currently, when creating a backup the Panel sends a request to Wings with information about the server, backup id, and adapter, then Wings hits another endpoint to get S3 pre-signed URLs once the backup is finished being created locally. We could possibly try sending a request to S3 before starting the backup (like a HeadObject to where the backup should be located). That would help diagnose 99% of configuration issues unless they are permission-related.

PseudoResonance commented 6 months ago

I'm having an issue where when I setup my S3 backups, I mistakenly didn't add the AWS_USE_PATH_STYLE_ENDPOINT=true variable, so my backups failed. Now when I go to delete them, the panel fails to delete them because they didn't exist in the first place and it logs a 403 error upon attempting to delete.

It'd be great if there was a force delete option or something to remove a nonexistent backup from the panel.