Full backup: carry on past a failing app, then keep the backup marked as partial
-
Following on from @james's suggestion in https://forum.cloudron.io/post/129999 .
What happens today
In
fullBackup()(src/backuptask.js, the same in 10.0.4, 10.0.5 and master), each app is backed up in turn inside a loop, and the first failure ends the whole run:const [appBackupError, appBackupResult] = await safe(backupAppWithTag(app, ...)); ... if (appBackupError) throw appBackupError;Mail and the system data are only backed up after the loop, so when one app fails, every app after it in the list, plus mail and the system data, gets no backup from that run. If the failure persists (an app whose
backupCommandkeeps failing, for example), the same thing happens every night.Why it matters
For a whole-server restore, one app with a flagged, incomplete backup is much better than a server where half the apps, the mail and the system data have no fresh backup, all because of an app that may sit early in the list.
It also leaves app packagers with two bad choices when a
backupCommandcannot produce a complete backup. Exiting non-zero is honest, but it costs every other app on the server its backup. Exiting zero protects the others, but hides the failure from the platform, so packages end up inventing their own notices (our Meilisearch package writes aBACKUP-FAILED.txtand repeats it in the log at every start). We would much rather fail honestly.What we are asking for
- When an app's backup fails, record the failure and carry on with the remaining apps, then mail and the system data.
- Keep the resulting backup, but mark it as partial, and name the app or apps that failed and why.
- Report the run as failed, with a notification naming those apps, so nothing passes as fine.
- For the failed apps, either leave them out of the partial backup or point to their last good backup, but say which, so that a restore from a partial backup warns before it restores an app from something older or incomplete.
- Do not let partial backups count towards retention in a way that prunes the last complete backup. Otherwise a week of partial runs could rotate out the only full one.
With that in place, packages can exit non-zero whenever their
backupCommandgenuinely fails, and the platform stays the one place where backup health is reported.We are happy to test a build against a package with a deliberately failing
backupCommand. -
L LoudLemur referenced this topic
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
