I’ve been having this issue with backups ever since setting up a NFS share to back up to.
The thing is, the backups do finish and work (the .tar file gets created), however the “tmp” dir that gets created while the backup is running, which stores the individual addon backups prior to being merged into the final backup never gets deleted.
If I initiate a backup in the UI of the Backups panel, it always ends with an error and says “See supervisor”.
Then there is this error (will post the full log at the bottom of this post):
OSError: [Errno 39] Directory not empty: '/data/mounts/BACKUPS/tmpf_hj_noe'
However, if I browse that directory, it is in fact empty.
I don’t think this is permissions related, since it can create and delete the tmp files… it just can’t delete that tmp directory, and always thinks there is an error.
This causes the “Home Assistant Google Drive Backup” addon (which I have since disabled from doing automatic backups for this reason) to never consider any backup to be complete. It just says “Pending…” and after 3 hours it times out and tries to create a new backup, and this just loops all day long.
I end up with an actual backup for every time it runs, but I am assuming due to that python error, it never accepts the fact that it actually completed. It is supposed to only run one time per day but I end up getting a backup every 3 hours because it apparently retries after that long if it doesn’t think the previous one worked.
(Also, from the command line if I run ha backups
, the backups are not listed even though the .tar file exists and appears to be valid backup data… so the error is preventing Home Assistant from believing the backup exists)
I’ve tried fiddling with the permissions on the NFS share (on UnRAID) and it is currently:
10.1.1.0/24(sec=sys,rw,insecure,anongid=100,anonuid=99,all_squash)
The files seem to all be created with the right user/group (nobody:users).
I just can’t figure out why the backup script thinks the directory is not empty when it is.
To be clear, this error happens whether I run it manually through the UI, or by calling “hassio.backup_full” in an automation, or if it runs through the Google Drive Backup addon.
Full Log:
23-10-02 10:38:55 INFO (MainThread) [supervisor.backups.manager] Creating new full backup with slug aa6c8d82
23-10-02 10:38:55 INFO (MainThread) [supervisor.backups.manager] Backup aa6c8d82 starting stage addons
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_phpmyadmin
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_phpmyadmin
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_sonweb
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_sonweb
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 15ef4d2f_esphome
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 15ef4d2f_esphome
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_ssh
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_ssh
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_aircast
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_aircast
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_logviewer
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_logviewer
23-10-02 10:38:55 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_mariadb
23-10-02 10:40:20 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_mariadb
23-10-02 10:40:20 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_zwavejs2mqtt
23-10-02 10:40:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_zwavejs2mqtt
23-10-02 10:40:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_mosquitto
23-10-02 10:40:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_mosquitto
23-10-02 10:40:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_chrony
23-10-02 10:40:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_chrony
23-10-02 10:40:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 6a15710b_tasmobackup
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 6a15710b_tasmobackup
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_appdaemon
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_appdaemon
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 424ccef4_crowdsec
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 424ccef4_crowdsec
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 424ccef4_crowdsec-firewall-bouncer
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 424ccef4_crowdsec-firewall-bouncer
23-10-02 10:40:25 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_vscode
23-10-02 10:40:26 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_vscode
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on db21ed7f_portainer
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon db21ed7f_portainer
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_nut
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_nut
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 3490a758_amcrest2mqtt-addon
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 3490a758_amcrest2mqtt-addon
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on cebe7a76_hassio_google_drive_backup
23-10-02 10:40:27 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon cebe7a76_hassio_google_drive_backup
23-10-02 10:40:27 INFO (MainThread) [supervisor.backups.manager] Backup aa6c8d82 starting stage home_assistant
23-10-02 10:40:27 INFO (MainThread) [supervisor.homeassistant.module] Backing up Home Assistant Core config folder
23-10-02 10:40:44 INFO (MainThread) [supervisor.homeassistant.module] Backup Home Assistant Core config folder done
23-10-02 10:40:44 INFO (MainThread) [supervisor.backups.manager] Backup aa6c8d82 starting stage folders
23-10-02 10:40:44 INFO (SyncWorker_0) [supervisor.backups.backup] Backing up folder share
23-10-02 10:40:44 INFO (SyncWorker_0) [supervisor.backups.backup] Backup folder share done
23-10-02 10:40:44 INFO (SyncWorker_1) [supervisor.backups.backup] Backing up folder addons/local
23-10-02 10:40:44 INFO (SyncWorker_1) [supervisor.backups.backup] Backup folder addons/local done
23-10-02 10:40:44 INFO (SyncWorker_1) [supervisor.backups.backup] Backing up folder ssl
23-10-02 10:40:44 INFO (SyncWorker_1) [supervisor.backups.backup] Backup folder ssl done
23-10-02 10:40:44 INFO (SyncWorker_5) [supervisor.backups.backup] Backing up folder media
23-10-02 10:40:44 INFO (SyncWorker_5) [supervisor.backups.backup] Backup folder media done
23-10-02 10:40:44 INFO (MainThread) [supervisor.backups.manager] Backup aa6c8d82 starting stage finishing_file
23-10-02 10:40:47 ERROR (MainThread) [supervisor.backups.manager] Backup aa6c8d82 error
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/backups/manager.py", line 239, in _do_backup
async with backup:
File "/usr/src/supervisor/supervisor/backups/backup.py", line 342, in __aexit__
self._tmp.cleanup()
File "/usr/local/lib/python3.11/tempfile.py", line 908, in cleanup
self._rmtree(self.name, ignore_errors=self._ignore_cleanup_errors)
File "/usr/local/lib/python3.11/tempfile.py", line 890, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "/usr/local/lib/python3.11/shutil.py", line 738, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/usr/local/lib/python3.11/shutil.py", line 736, in rmtree
os.rmdir(path, dir_fd=dir_fd)
OSError: [Errno 39] Directory not empty: '/data/mounts/BACKUPS/tmpf_hj_noe'