panel icon indicating copy to clipboard operation
panel copied to clipboard

Rotated backups not deleted

Open ajgeiss0702 opened this issue 3 years ago • 7 comments

Current Behavior

When backups should be rotated (with scheduled backups and a server backup limit), they are removed from the panel but not deleted from S3.

(note that deleting them manually works as it should)

Expected Behavior

When backups disappear from the panel, they should be removed from S3 too.

Steps to Reproduce

  1. Set a backup limit for a server
  2. Schedule a backup
  3. Wait for the backups to reach the server limit
  4. Notice they disappear from the panel backup list, but not from S3

Panel Version

1.10.1

Wings Version

1.7.0

Games and/or Eggs Affected

N/A

Docker Image

N/A

Error Logs

No error log (No such file or directory)

Is there an existing issue for this?

  • [X] I have searched the existing issues before opening this issue.
  • [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.

ajgeiss0702 avatar Sep 18 '22 21:09 ajgeiss0702

The closest I've found to my issue is #3221 however theirs didn't work even when manually deleting, however, mine are. They simply are not deleted automatically (and accumulate storage and costs)

ajgeiss0702 avatar Sep 18 '22 21:09 ajgeiss0702

Looking through the code, rotated backups are indeed deleted.

https://github.com/pterodactyl/panel/blob/develop/app/Services/Backups/InitiateBackupService.php#L149 https://github.com/pterodactyl/panel/blob/develop/app/Services/Backups/DeleteBackupService.php#L70-L74

If they aren't getting deleted then I'd make sure to check your logs, as the same logic is used when manually deleting backups.

matthewpi avatar Sep 18 '22 21:09 matthewpi

There was no error log, and the backup was not being deleted. They are deleted when manual deletion, so something must be different somewhere

ajgeiss0702 avatar Sep 19 '22 00:09 ajgeiss0702

Some S3 providers will retain the file and just "flag" it as deleted. It's then up to retention policies to actually delete the file. When you say deleting them manually works, do you mean in your S3 providers website, or in the panel?

danny6167 avatar Sep 19 '22 00:09 danny6167

Some S3 providers will retain the file and just "flag" it as deleted. It's then up to retention policies to actually delete the file. When you say deleting them manually works, do you mean in your S3 providers website, or in the panel?

Both. Manually deleting appears to remove it from both the panel and the aws console. Rotating only removes it from the panel

ajgeiss0702 avatar Sep 19 '22 00:09 ajgeiss0702

Have you tried restarting the queue worker? It might be using old values for the environment variables if you modified them without restarting the queue worker after making your changes.

sudo systemctl restart pteroq.service

matthewpi avatar Sep 21 '22 18:09 matthewpi

sudo systemctl restart pteroq.service

I think I did, but I’m not 100% sure. I’ll try that and see how it goes

initial testing shows that it appears to have been fixed. I’ll double check tonight, then close this issue as long as it’s fixed.

thank you @matthewpi Surprising that neither I, or anyone in the discord thought of that 😄

ajgeiss0702 avatar Sep 21 '22 18:09 ajgeiss0702

Yep, that definitely fixed it. Thank you 😊

ajgeiss0702 avatar Sep 23 '22 00:09 ajgeiss0702