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
73.99k stars 31.03k forks source link

System-Backups timing out with too many files on a NAS backup location #129331

Open solstyce9 opened 4 weeks ago

solstyce9 commented 4 weeks ago

The problem

Config:

I run daily/monthly/quarterly/backups via the hassio.backup_full action and every week or two go into Storage > Backups to manually delete old backups.

Normally when I go in to view and delete backups it takes 10-15 seconds for the backup list to appear. Last week I noticed the list wasn't appearing no matter how long I waited, but my nightly backup was still running.

I posted on the HA community: https://community.home-assistant.io/t/cant-view-backups-in-storage-location/787320/3 and someone mentioned they see this problem when they have 100+ files in their backup folder. I had 64 files taking 76GB of space. I deleted backups from the NAS one by one and once I got to 53 files taking 49 GB, my backups started appearing in the web interface again.

I was doing a lot of "reload" from the web UI and looking at my logs I see

Logger: homeassistant.components.hassio.handler
Source: components/hassio/handler.py:557
integration: Home Assistant Supervisor (documentation, issues)
First occurred: October 27, 2024 at 9:46:19 AM (20 occurrences)
Last logged: 9:11:39 AM

Timeout on /backups/reload request

Assuming this timeout is what's causing the problem, it would be nice if we could do one or all of -

  1. avoid the timeout via performance improvements
  2. extend the timeout
  3. surface the timeout in the web UI when it happens

Thanks!

What version of Home Assistant Core has the issue?

core-2024.10.4

What was the last working version of Home Assistant Core?

core-2024.10.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

alias: "Service: full backup daily"
description: >-
  Full backup Mon-Sun at 2am to \\nas1\misc\backups\home_assistant\${DATE)
  except on first day of month or first day of quarter or first day of year
mode: single
triggers:
  - at: "02:00:00"
    trigger: time
conditions:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
  - condition: template
    value_template: >-
      {{ now().day in
      [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]
      }}
actions:
  - data:
      compressed: true
      name: "{{ now().strftime('%Y-%m-%d') }} daily backup"
    action: hassio.backup_full

Anything in the logs that might be useful for us?

Logger: homeassistant.components.hassio.handler
Source: components/hassio/handler.py:557
integration: Home Assistant Supervisor (documentation, issues)
First occurred: October 27, 2024 at 9:46:19 AM (20 occurrences)
Last logged: 9:11:39 AM

Timeout on /backups/reload request

Additional information

No response

home-assistant[bot] commented 4 weeks ago

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

Code owner commands Code owners of `hassio` 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 hassio` 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)


hassio documentation hassio source (message by IssueLinks)