home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.06k stars 30.18k forks source link

[supervisor.backups.manager] Error closing tarfile #111769

Closed nicknol closed 3 months ago

nicknol commented 7 months ago

The problem

When trying to create a backup it runs into an error: [supervisor.backups.manager] Error closing tarfile

I noticed that the backup is created successfully when I exclude the MariaDB addon. And vice versa, trying to backup only the MariaDB fails. The behavior is observed regardless whether I stop the MariaDB or let in run. The unpacked size of the MariaDB is about 14GB,

The backup worked until FEB-20, but I am not sure what has changed on that date.

What version of Home Assistant Core has the issue?

core-2024.2.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Backup

Link to integration documentation on our website

https://www.home-assistant.io/integrations/backup/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Supervisor log

24-02-28 23:14:08 ERROR (MainThread) [supervisor.backups.manager] Backup 26c6f681 error
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/backups/manager.py", line 261, in _do_backup
    async with backup:
  File "/usr/src/supervisor/supervisor/backups/backup.py", line 363, in __aexit__
    self._outer_secure_tarfile.__exit__(
  File "/usr/local/lib/python3.12/site-packages/securetar/__init__.py", line 140, in __exit__
    self._tar.close()
  File "/usr/local/lib/python3.12/tarfile.py", line 1975, in close
    self.fileobj.close()
OSError: [Errno 5] I/O error

Additional information

I use a NAS as my storage device, there is suffiicient diskspace available. A tar file is created on the NAS, but trying to open it results in 'corrupted tar file' (or similar). Backups created before FEB-20 are not corrupted.

home-assistant[bot] commented 7 months ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (backup) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `backup` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign backup` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


backup documentation backup source (message by IssueLinks)

nicknol commented 6 months ago

I've upgraded homeassistant and supervisor to the latest versions. Unfortunately the issue remains. Version core-2024.3.1 Home Assistant OS 12.1 supervisor-2024.03.0 Storage total 468.7 GB Storage used 115.9 GB

Please find the extract from the supervisor log.

24-03-16 09:31:20 INFO (MainThread) [supervisor.backups.manager] Backup c73bb3da starting stage addon_repositories
24-03-16 09:31:20 INFO (MainThread) [supervisor.backups.manager] Backup c73bb3da starting stage docker_config
24-03-16 09:31:20 INFO (MainThread) [supervisor.backups.manager] Creating new full backup with slug c73bb3da
24-03-16 09:31:20 INFO (MainThread) [supervisor.backups.manager] Backup c73bb3da starting stage addons
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_ssh
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_ssh
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_samba
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_samba
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_vscode
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_vscode
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_ssh
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_ssh
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_mosquitto
24-03-16 09:31:20 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_mosquitto
24-03-16 09:31:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on b9f12d83_psacc
24-03-16 09:31:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon b9f12d83_psacc
24-03-16 09:31:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_piper
24-03-16 09:31:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_piper
24-03-16 09:31:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_whisper
24-03-16 09:31:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_whisper
24-03-16 09:31:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_mariadb
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_mariadb
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on a0d7b954_phpmyadmin
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon a0d7b954_phpmyadmin
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_silabs_flasher
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_silabs_flasher
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 229cc4d7_nextcloud_backup
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 229cc4d7_nextcloud_backup
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 49686a9f_evcc
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 49686a9f_evcc
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on core_openwakeword
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon core_openwakeword
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Building backup for add-on 5c53de3b_esphome
24-03-16 09:32:21 INFO (MainThread) [supervisor.addons.addon] Finish backup for addon 5c53de3b_esphome
24-03-16 09:32:21 INFO (MainThread) [supervisor.backups.manager] Backup c73bb3da starting stage home_assistant
24-03-16 09:32:24 INFO (MainThread) [supervisor.homeassistant.module] Backing up Home Assistant Core config folder
24-03-16 09:32:53 INFO (MainThread) [supervisor.homeassistant.module] Backup Home Assistant Core config folder done
24-03-16 09:32:53 INFO (MainThread) [supervisor.backups.manager] Backup c73bb3da starting stage folders
24-03-16 09:32:53 INFO (SyncWorker_4) [supervisor.backups.backup] Backing up folder share
24-03-16 09:32:53 INFO (SyncWorker_4) [supervisor.backups.backup] Backup folder share done
24-03-16 09:32:53 INFO (SyncWorker_6) [supervisor.backups.backup] Backing up folder addons/local
24-03-16 09:32:53 INFO (SyncWorker_6) [supervisor.backups.backup] Backup folder addons/local done
24-03-16 09:32:53 INFO (SyncWorker_1) [supervisor.backups.backup] Backing up folder ssl
24-03-16 09:32:53 INFO (SyncWorker_1) [supervisor.backups.backup] Backup folder ssl done
24-03-16 09:32:53 INFO (SyncWorker_0) [supervisor.backups.backup] Backing up folder media
24-03-16 09:32:53 INFO (SyncWorker_0) [supervisor.backups.backup] Backup folder media done
24-03-16 09:32:53 INFO (MainThread) [supervisor.backups.manager] Backup c73bb3da starting stage finishing_file
24-03-16 09:33:53 ERROR (MainThread) [supervisor.backups.manager] Backup c73bb3da error
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/backups/manager.py", line 261, in _do_backup
    async with backup:
  File "/usr/src/supervisor/supervisor/backups/backup.py", line 363, in __aexit__
    self._outer_secure_tarfile.__exit__(
  File "/usr/local/lib/python3.12/site-packages/securetar/__init__.py", line 140, in __exit__
    self._tar.close()
  File "/usr/local/lib/python3.12/tarfile.py", line 1975, in close
    self.fileobj.close()
OSError: [Errno 5] I/O error
issue-triage-workflows[bot] commented 3 months ago

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 Home Assistant 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.