supervisor icon indicating copy to clipboard operation
supervisor copied to clipboard

Backup succeeds on pre/post failure

Open frenck opened this issue 3 years ago • 2 comments

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

  1. Add mariadb core add-on to your add-ons folder
  2. Replace backup_post & backup_pre with an invalid command
  3. Install and run your local/patched mariadb add-on
  4. Create a partial backup with only the mariadb add-on
  5. The backup is created and shown in the interface.
  6. 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

frenck avatar Jun 13 '22 10:06 frenck

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.

mdegat01 avatar Jul 07 '22 20:07 mdegat01

This is more a thing for the resolution centre (eventually)

frenck avatar Jul 07 '22 20:07 frenck

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.

github-actions[bot] avatar Sep 05 '22 21:09 github-actions[bot]