
[Bug] Oldest backup removed after failed backup
lupusagax opened this issue ยท 1 comments
Versions
- ftbbackups2-forge-1.19.2-1.0.23
- forge-1.19.2-43.4.5
Summary
If there is currently the max number of backups and a new backup fails, FTB Backups removes the oldest backup even though it does not need to.
Log
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Attempting to create an automatic backup
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Found world folder at /server/./world/.
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Last backup size: 832.0MB Current world size: 1.4GB Current Available space: 28.2GB ExpectedSize 866.6MB
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world minecraft:overworld save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world minecraft:the_nether save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world compactmachines:compact_world save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world ftbschools:school_night save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world minecraft:the_end save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world jamd:mining save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world ftbschools:school_day save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Setting world ae2:spatial_storage save state to true
[12:30:00] [ftbbackups2_Worker-1/INFO] [ne.cr.ft.FTBBackups/]: Writing to file /server/backups/backups.json
[12:30:00] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Waiting for world save to complete.
[12:30:30] [FTB Backups backup thread 0/ERROR] [ne.cr.ft.FTBBackups/]: Failed to create backup
java.util.concurrent.TimeoutException: null
at java.util.concurrent.CompletableFuture.timedGet(Unknown Source) ~[?:?] {re:mixin}
at java.util.concurrent.CompletableFuture.get(Unknown Source) ~[?:?] {re:mixin}
at net.creeperhost.ftbbackups.BackupHandler.lambda$createBackup$1(BackupHandler.java:230) ~[ftbbackups2-forge-1.19.2-1.0.23.jar%23454!/:?] {re:classloading}
at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) ~[?:?] {}
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?] {}
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?] {}
at java.lang.Thread.run(Unknown Source) ~[?:?] {re:mixin}
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world minecraft:overworld save state to false
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world minecraft:the_nether save state to false
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world compactmachines:compact_world save state to false
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world ftbschools:school_night save state to false
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world minecraft:the_end save state to false
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world jamd:mining save state to false
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world ftbschools:school_day save state to false
[12:30:30] [FTB Backups backup thread 0/INFO] [ne.cr.ft.FTBBackups/]: Setting world ae2:spatial_storage save state to false
[12:30:38] [spark-async-sampler-worker-thread/WARN] [spark/]: Timed out waiting for world statistics
[12:30:47] [FTB Backups scheduled executor 0/INFO] [ne.cr.ft.FTBBackups/]: More backups than 5 found, Removing oldest backup
[12:30:47] [FTB Backups scheduled executor 0/INFO] [ne.cr.ft.FTBBackups/]: Removed old backup 2025-5-19_19-30-0.zip
[12:30:47] [FTB Backups scheduled executor 0/INFO] [ne.cr.ft.FTBBackups/]: File missing, removing from backups /server/backups/2025-5-19_19-30-0.zip
[12:30:47] [FTB Backups scheduled executor 0/INFO] [ne.cr.ft.FTBBackups/]: File missing, removing from backups /server/backups/2025-5-20_12-30-0.zip
[12:30:47] [FTB Backups scheduled executor 0/INFO] [ne.cr.ft.FTBBackups/]: Writing to file /server/backups/backups.json
After backup was attempted:
$ ls server/backups/
2025-5-19_20-0-0.zip 2025-5-19_20-30-0.zip 2025-5-19_21-0-0.zip 2025-5-19_21-30-0.zip backups.json
Only 4 backups present in folder. Set to keep 5 in config.
"retention_mode": "MAX_BACKUPS",
// Applies to retention_mode:MAX_BACKUPS, Sets the maximum number of backups to keep
"max_backups": 5,
(For additional context, this happened while testing a server tick hang issue, so the timeout was expected. It removing the oldest backup was not. Thankfully I had already copied that backup outside the folder because I needed that exact one for testing)