Backup succeeds on pre/post failure
Describe the issue you are experiencing
An add-on backup completes, even-though the add-on has pre/post command (that failed).
What is the used version of the Supervisor?
supervisor-2022.06.dev0903
What type of installation are you running?
Home Assistant Supervised
Which operating system are you running on?
Debian
What is the version of your installed operating system?
Debian 11
What version of Home Assistant Core is installed?
2022.6.5
Steps to reproduce the issue
- Add
mariadbcore add-on to your add-ons folder - Replace
backup_post&backup_prewith an invalid command - Install and run your local/patched
mariadbadd-on - Create a partial backup with only the
mariadbadd-on - The backup is created and shown in the interface.
- Supervisor logs show the error; which the user was not aware of
Anything in the Supervisor logs that might be useful for us?
22-06-13 12:10:48 INFO (SyncWorker_4) [supervisor.docker.addon] Export image local/amd64-addon-mariadb to /data/tmp/tmpymws_01k/image.tar
22-06-13 12:10:48 INFO (SyncWorker_4) [supervisor.docker.addon] Export image local/amd64-addon-mariadb done
22-06-13 12:10:48 ERROR (MainThread) [supervisor.addons.addon] Pre-/Post backup command returned error code: 126
22-06-13 12:10:48 ERROR (MainThread) [supervisor.backups.backup] Can't create backup for local_mariadb
Additional information
No response
Ok I see what's happening. So it catches and squashes this error here: https://github.com/home-assistant/supervisor/blob/389aab8d4a4b51119b50c8cb13bafff85515a814/supervisor/backups/backup.py#L320-L324
But the reason it does this is because it always wants to backup as much as it can. If one addon fails it wants to continue on and still make a backup of everything else the user asked for. This behavior is sensible... unless that was the only addon in the backup.
Or I guess a better way to phrase it would be this behavior makes no sense when everything supervisor was asked to backup failed. As long as at least one thing succeeded we should keep the backup. But if everything failed then its useless and the entire process should exit with an error.
This is more a thing for the resolution centre (eventually)
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.