hassio-addons icon indicating copy to clipboard operation
hassio-addons copied to clipboard

Backups are created, but not synced to NAS

Open twangraus opened this issue 2 years ago • 15 comments

Hey guys,

Previously, this was running perfect. I noticed the reserved storage on the NAS was full, so i expended it to allow more backups. When the backup is started now, it will be created, but not transferred to the NAS. This also results in more local backups then specified in the configuration. I trigger a script to start the backups. The logs show backup succesfull. Each backup is about 2GB, and takes 3 hours to create

host: [[Hidden]]
share: HomeAssistant
target_dir: ''
username: Username
password: Password
keep_local: 3
keep_remote: 30
trigger_time: manual
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []
backup_name: Snapshot {type} {version} {date}

image

twangraus avatar Sep 26 '21 09:09 twangraus

I have the same issue but the share never ran out of free space. Tried removing and installing the add-on but the problem remains. I have the following message in the log: parse error: Invalid numeric literal at line 1, column 5

floris-b avatar Oct 11 '21 17:10 floris-b

I am also having the same issue, nothing changed and still space available but my last backup on my remote storage is 6 October 2021 I also have the parse error: Invalid numeric literal at line 1, column 5 in my logs

Drewskieza avatar Oct 26 '21 06:10 Drewskieza

I have the same issue as well. Daily backups were transferred to my DiskStation successfully until Oct 10, then one last time on Oct 14 - nothing after that. Found out because local backups finally filled the HomeAssistant SSD because they don’t get deleted anymore.

sebster6 avatar Oct 28 '21 15:10 sebster6

Everything was running perfectly here as well until end october...last backup to NAS 29 oct. Same parsing problem. In recycle folder into the backup partition on my synology tmp-files were created with zero bytes size Screen Shot 2021-11-15 at 14 33 50

peterdierckx2840 avatar Nov 15 '21 13:11 peterdierckx2840

Can anybody please attach a log file that shows the startup of the addon and a backup?

@peterdierckx2840 Those are just empty temp files that are created and deleted on startup to check write permissions. You have enabled some kind of recycle bin feature on your NAS which is why those files are moved to that folder instead of being deleted directly.

thomasmauerer avatar Nov 15 '21 16:11 thomasmauerer

[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. [21-11-15 17:15:29] INFO: --------------------------------------------------- [21-11-15 17:15:29] INFO: Host/Share: 192.168.1.10/backup [21-11-15 17:15:29] INFO: Target directory: HA [21-11-15 17:15:30] INFO: Keep local/remote: 3/31 [21-11-15 17:15:30] INFO: Trigger time: 03:00 [21-11-15 17:15:30] INFO: Trigger days: Mon Wed Fri [21-11-15 17:15:30] INFO: --------------------------------------------------- [21-11-15 17:15:30] DEBUG: Backups local: 8 [21-11-15 17:15:30] DEBUG: Backups remote: 1 [21-11-15 17:15:30] DEBUG: Total backups succeeded: 36 [21-11-15 17:15:30] DEBUG: Total backups failed: 15 [21-11-15 17:15:30] DEBUG: Last backup: 2021-09-08 06:07 [21-11-15 17:15:30] DEBUG: API Status: 200 [21-11-15 17:15:30] DEBUG: API Response: {"entity_id": "sensor.samba_backup", "state": "IDLE", "attributes": {"friendly_name": "Samba Backup", "backups_local": "8", "backups_remote": "1", "total_backups_succeeded": "36", "total_backups_failed": "15", "last_backup": "2021-09-08 06:07"}, "last_changed": "2021-11-15T16:14:24.637643+00:00", "last_updated": "2021-11-15T16:14:24.637643+00:00", "context": {"id": "3246cc12d5f3b38cb2b3b3d9483084fd", "parent_id": null, "user_id": "9bc0c33c8a0049aaa4af495b7c99893d"}} [21-11-15 17:15:30] DEBUG: [21-11-15 17:15:30] DEBUG: putting file samba-tmp123 as \HA\samba-tmp123 (0.0 kb/s) (average 0.0 kb/s) [21-11-15 17:15:30] INFO: Samba Backup started successfully [21-11-15 17:15:30] DEBUG: Starting stdin listener ... [21-11-15 17:15:30] DEBUG: Starting main loop ...

[21-11-15 03:00:44] INFO: Creating backup "Samba Backup 2021-11-15 03:00" parse error: Invalid numeric literal at line 1, column 5 [21-11-15 06:00:44] DEBUG: API Status: 200 [21-11-15 06:00:44] DEBUG: API Response: {"entity_id": "sensor.samba_backup", "state": "FAILED", "attributes": {"friendly_name": "Samba Backup", "backups_local": "8", "backups_remote": "1", "total_backups_succeeded": "36", "total_backups_failed": "15", "last_backup": "2021-09-08 06:07"}, "last_changed": "2021-11-15T05:00:44.481017+00:00", "last_updated": "2021-11-15T05:00:44.481017+00:00", "context": {"id": "bf6b6b83f755817f50685b5f9ce1c2f0", "parent_id": null, "user_id": "9bc0c33c8a0049aaa4af495b7c99893d"}} [21-11-15 06:00:54] DEBUG: API Status: 200 [21-11-15 06:00:54] DEBUG: API Response: {"entity_id": "sensor.samba_backup", "state": "IDLE", "attributes": {"friendly_name": "Samba Backup", "backups_local": "8", "backups_remote": "1", "total_backups_succeeded": "36", "total_backups_failed": "15", "last_backup": "2021-09-08 06:07"}, "last_changed": "2021-11-15T05:00:54.562231+00:00", "last_updated": "2021-11-15T05:00:54.562231+00:00", "context": {"id": "bc77647bafee2c0a755d188748951812", "parent_id": null, "user_id": "9bc0c33c8a0049aaa4af495b7c99893d"}} [21-11-15 06:00:54] INFO: Backup finished

floris-b avatar Nov 15 '21 16:11 floris-b

Thanks. The root cause here is a timeout. The CLI command that creates the backup returns with an error after exactly 3 hours --> https://github.com/home-assistant/cli/commit/47adcfa75f55c1adac43caa52ef0667bf130dc92

I'm not sure if there will be a solution to this, as the timeouts have most likely been implemented with a reason and 3 hours is already quite long. You probably need to exclude some heavy addons (like a database) to speed up the backup creation.

thomasmauerer avatar Nov 15 '21 20:11 thomasmauerer

I have the same symptoms but maybe a different cause. I have these errors:

[21-11-16 11:02:02] INFO: Backup running ...
[21-11-16 11:02:03] INFO: Creating backup "Full Snapshot (Samba Backup) 2021-11-16 11:02"
[21-11-16 12:54:00] INFO: Copying backup cb13273f (Samba_Backup_Full_Snapshot_(Samba_Backup)_2021_11_16_11_02.tar) to share
[21-11-16 13:06:50] WARNING: cli_push returned NT_STATUS_IO_TIMEOUT
NT_STATUS_IO_TIMEOUT closing remote file \Samba_Backup_Full_Snapshot_(Samba_Backup)_2021_11_16_11_02.tar
[21-11-16 13:06:50] WARNING: Could not copy backup cb13273f to share. Trying again ...
[21-11-16 13:17:08] WARNING: cli_push returned NT_STATUS_IO_TIMEOUT
NT_STATUS_IO_TIMEOUT closing remote file \Samba_Backup_Full_Snapshot_(Samba_Backup)_2021_11_16_11_02.tar
[21-11-16 13:17:19] INFO: Backup finished

Since the backup gets created (3,5 GB) it seems to me not a cli timeout as described above, but an SMB timeout? I saw in samba-backup/rootfs/scripts/config.sh this line: SMB="smbclient -U \"${username}\"%\"${password}\" \"//${host}/${share}\" 2>&1 -t 180" Should I try to increase this time? I have no clue how to do this in a container. Or could network issues be the cause? I couldn't find any error on my NAS.

PS: where can I get logs in the format above for this addon?

Thanks for any help!

JeeCee1 avatar Nov 16 '21 13:11 JeeCee1

Thanks for following up the problem. feedback and solution of my problem.... I resized by excluding the influx database (core_influxdb) and by deleting the home-assistant_v2.db history database. Total size of backup became too big to handle the backup-to-NAS process within the 3 hours. Local backup part of the samba backup performed always well no matter the size of the backup file.

peterdierckx2840 avatar Nov 16 '21 15:11 peterdierckx2840

forgot to mention you all...........Thanks for following up the problem. feedback and solution of my problem.... I resized by excluding the influx database (core_influxdb) and by deleting the home-assistant_v2.db history database. Total size of backup became too big to handle the backup-to-NAS process within the 3 hours. Local backup part of the samba backup performed always well no matter the size of the backup file. @sebster6 @twangraus @floris-b @Drewskieza @thomasmauerer

peterdierckx2840 avatar Nov 16 '21 15:11 peterdierckx2840

I am having an issue in which the backups take a long time and then HA will eventually lock up and I am forced to SSH into the blue and do a reboot. Reading this thread, it sounds like it's a timeout issue somewhere in the system. I'll try to limit my backup size by excluding some items. I hate to exclude influxdb because that contains my data history but that may be one of my options as it's the biggest in size.

mostlychris avatar Dec 23 '21 16:12 mostlychris

So, I also have this problem since december 2021... what happened then? Was that around the time snapshots were renamed backup in home assistant? I think my setup is not that big... but none work via samba backup anymore...

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22-02-16 12:37:39] INFO: ---------------------------------------------------
[22-02-16 12:37:39] INFO: Host/Share: 192.168.3.99/backupshare
[22-02-16 12:37:39] INFO: Target directory: /homeassistant
[22-02-16 12:37:39] INFO: Keep local/remote: 1/10
[22-02-16 12:37:39] INFO: Trigger time: 01:00
[22-02-16 12:37:39] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[22-02-16 12:37:39] INFO: ---------------------------------------------------
[22-02-16 12:37:39] DEBUG: Backups local: 9
[22-02-16 12:37:39] DEBUG: Backups remote: 10
[22-02-16 12:37:39] DEBUG: Total backups succeeded: 0
[22-02-16 12:37:39] DEBUG: Total backups failed: 13
[22-02-16 12:37:39] DEBUG: Last backup: 2021-12-12 04:03
[22-02-16 12:37:39] DEBUG: API Status: 200
[22-02-16 12:37:39] DEBUG: API Response: {"entity_id": "sensor.samba_backup", "state": "IDLE", "attributes": {"friendly_name": "Samba Backup", "backups_local": "9", "backups_remote": "10", "total_backups_succeeded": "0", "total_backups_failed": "13", "last_backup": "2021-12-12 04:03"}, "last_changed": "2022-02-16T11:32:24.379351+00:00", "last_updated": "2022-02-16T11:32:24.379351+00:00", "context": {"id": "343fc649e90fdfe8adcb8e1d1f0a9146", "parent_id": null, "user_id": "66186115e80946759ca30229ee09d978"}}
[22-02-16 12:37:40] DEBUG: 
[22-02-16 12:37:40] DEBUG: putting file samba-tmp123 as \homeassistant\samba-tmp123 (0.0 kb/s) (average 0.0 kb/s)
[22-02-16 12:37:40] INFO: Samba Backup started successfully
[22-02-16 12:37:40] DEBUG: Starting stdin listener ...
[22-02-16 12:37:40] DEBUG: Starting main loop ...
[22-02-16 12:37:52] DEBUG: Input received: "trigger"
[22-02-16 12:37:52] INFO: Backup running ...
[22-02-16 12:37:52] DEBUG: Backups local: 9
[22-02-16 12:37:52] DEBUG: Backups remote: 10
[22-02-16 12:37:52] DEBUG: Total backups succeeded: 0
[22-02-16 12:37:52] DEBUG: Total backups failed: 13
[22-02-16 12:37:52] DEBUG: Last backup: 2021-12-12 04:03
[22-02-16 12:37:52] DEBUG: API Status: 200
[22-02-16 12:37:52] DEBUG: API Response: {"entity_id": "sensor.samba_backup", "state": "RUNNING", "attributes": {"friendly_name": "Samba Backup", "backups_local": "9", "backups_remote": "10", "total_backups_succeeded": "0", "total_backups_failed": "13", "last_backup": "2021-12-12 04:03"}, "last_changed": "2022-02-16T11:37:52.344199+00:00", "last_updated": "2022-02-16T11:37:52.344199+00:00", "context": {"id": "199380a45b76d9070e571edf6c52c8ff", "parent_id": null, "user_id": "66186115e80946759ca30229ee09d978"}}
[22-02-16 12:37:52] INFO: Creating backup "Samba Backup 2022-02-16 12:37"
parse error: Invalid numeric literal at line 1, column 5
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

sanderlv avatar Feb 16 '22 14:02 sanderlv

The reason is that timeouts have been implemented in the Home Assistant CLI. As long as #79 is not implemented, you have to make sure that your backup finishes in less than 3 hours. Do you really need to backup the entire DB everyday? Just for comparison, a backup on my setup takes 2 minutes.

You can extract a backup file to find out how big each addon is tar -xvf <your-backup.tar>

thomasmauerer avatar Feb 17 '22 11:02 thomasmauerer

Don't need it every day, but I cannot differentiate with samba backup... it's all or none...

sanderlv avatar Feb 17 '22 17:02 sanderlv

Hey together!

Is there any recommended "exclude" Filter? Which one can be used on the fly? What do you exclude?

DarthDestroyer avatar Jun 16 '22 16:06 DarthDestroyer

Seeing this for my bigger backups (> 3 GB) too.

I thought processing the transfer via WiFi would be the issue. "Glad" I found this issue here...

bcutter avatar Apr 15 '23 10:04 bcutter

Can someone help on this?

guciopl avatar May 23 '23 18:05 guciopl