jcwillox / hass-auto-backup

🗃️ Improved Backup Service for Home Assistant that can Automatically Remove Backups and Supports Generational Backup Schemes.
https://jcwillox.github.io/hass-auto-backup
MIT License
368 stars 27 forks source link

Timeout on /backups/new/partial request. There may be a backup already in progress. #91

Closed 66krieger closed 1 year ago

66krieger commented 1 year ago

The problem

hi, an hour after the automatic start of the daily backup I get an error message "Timeout on /backups/new/partial request. There may be a backup already in progress. ". This is what my automation looks like: alias: Backup - täglich/wöchentlich/monatlich Autobackup von jcwillox description: ab 15.02.2023 use_blueprint: path: jcwillox/automatic_backups.yaml input: enable_hourly: false enable_daily: true enable_weekly: false enable_monthly: false enable_yearly: false use_action_hourly: false backup_action:

What am I wrong? Thanks to you.

What version of Auto Backup has the issue?

1.3.1

What version of Home Assistant are you running?

Home Assistant 2023.3.1

What type of installation are you running?

Home Assistant Supervised

If you're running HA OS/Supervised, what version of the Supervisor are you running?

Home Assistant 2023.3.1

Example YAML snippet

#This is my "automatics_backup.yaml" full
blueprint:
  name: Automatic Backups
  description: 'Create backups each day and keep them for a configurable amount of
    time, backups are stored less frequently the older they are.

    By default all backups are full backups, besides the 3-hourly backups which only
    include the configuration.

    **Template Variables:**

    - `name` — backup name configured below

    - `password` — backup password configured below

    - `keep_days` — days the backup is kept for based on the current backup type

    - `backup_type` — current schedule being created, e.g., `daily`, `weekly`, `monthly`

    **Note: requires the [Auto Backup](https://jcwillox.github.io/hass-auto-backup)
    custom integration.**

    '
  domain: automation
  input:
    backup_name:
      name: Name template used for backups
      default: "{{ backup_type | title }}Backup: {{\n  now().strftime(\n    \"%A,
        \"\n    ~ iif(backup_type == \"hourly\", \"%-I:%M %p, \", \"\")\n    ~ \"%B
        %-d, %Y\"\n  )\n}}\n{# HourlyBackup: Monday, 3:04 PM, January 2, 2006 #}\n{#
        DailyBackup: Monday, January 2, 2006 #}\n"
      selector:
        template: {}
    backup_time:
      name: Time of day to create backups
      default: 02:30:00
      selector:
        time: {}
    backup_password:
      name: Backup Password (Optional)
      default: ''
      selector:
        text:
          type: password
          multiline: false
    enable_hourly:
      name: 'Enable: Hourly Backups'
      description: Create a backup every 3 hours and store for 2 days
      default: false
      selector:
        boolean: {}
    enable_daily:
      name: 'Enable: Daily Backups'
      description: Create a backup each day and store for a week
      default: true
      selector:
        boolean: {}
    enable_weekly:
      name: 'Enable: Weekly Backups'
      description: Create a backup each week and store for a month
      default: true
      selector:
        boolean: {}
    enable_monthly:
      name: 'Enable: Monthly Backups'
      description: Create a backup each month and store for a year
      default: true
      selector:
        boolean: {}
    enable_yearly:
      name: 'Enable: Yearly Backups'
      description: Create a backup each year and store forever
      default: true
      selector:
        boolean: {}
    use_action_hourly:
      name: Use Backup Action for Hourly Backups Only
      description: Otherwise, it will be used for all backup types
      default: true
      selector:
        boolean: {}
    backup_action:
      name: Backup Action (Optional)
      description: 'Optionally override the built-in backup action with a custom action,
        designed to allow greater control over what is included in each backup.

        By default this only overrides the 3-hourly backups, so that they only include
        the configuration.

        '
      default:
      - service: auto_backup.backup
        data:
          name: '{{ name }}'
          password: '{{ password }}'
          keep_days: '{{ keep_days }}'
          include_folders:
          - config
      selector:
        action: {}
    condition:
      name: Condition (Optional)
      description: Condition to test before any action
      default: []
      selector:
        action: {}
  source_url: https://raw.githubusercontent.com/jcwillox/home-assistant-blueprints/main/automation/automatic_backups.yaml
mode: single
variables:
  password: !input backup_password
  enable_hourly: !input enable_hourly
  enable_daily: !input enable_daily
  enable_weekly: !input enable_weekly
  enable_monthly: !input enable_monthly
  enable_yearly: !input enable_yearly
  use_action_hourly: !input use_action_hourly
trigger:
- id: daily
  platform: time
  at: !input backup_time
- id: hourly
  enabled: !input enable_hourly
  platform: time_pattern
  hours: /3
condition: !input condition
action:
- if:
    condition: trigger
    id: daily
  then:
  - choose:
    - conditions:
      - '{{ enable_yearly }}'
      - '{{ now().day == 1 and now().month == 1 }}'
      sequence:
      - variables:
          backup_type: yearly
          keep_days:
      - &id001
        variables:
          name: !input backup_name
          backup_action: !input backup_action
      - &id002
        if:
        - '{{ not use_action_hourly }}'
        - '{{ backup_action | length > 0 }}'
        then: !input backup_action
        else:
        - alias: Creating a full backup (default action)
          service: auto_backup.backup
          data:
            name: '{{ name }}'
            password: '{{ password }}'
            keep_days: '{{ keep_days }}'
    - conditions:
      - '{{ enable_monthly }}'
      - '{{ now().day == 1 }}'
      sequence:
      - variables:
          backup_type: monthly
          keep_days: 365
      - *id001
      - *id002
    - conditions:
      - '{{ enable_weekly }}'
      - '{{ now().weekday() == 0 }}'
      sequence:
      - variables:
          backup_type: weekly
          keep_days: 30.4167
      - *id001
      - *id002
    - conditions:
      - '{{ enable_daily }}'
      sequence:
      - variables:
          backup_type: daily
          keep_days: 7
      - *id001
      - *id002
  else:
  - variables:
      backup_type: hourly
      keep_days: 2
  - *id001
  - if: '{{ backup_action | length > 0 }}'
    then: !input backup_action
    else:
    - alias: Creating a partial backup (default action)
      service: auto_backup.backup
      data:
        name: '{{ name }}'
        password: '{{ password }}'
        keep_days: '{{ keep_days }}'
        include_folders:
        - config

Anything in the logs that might be useful for us?

No response

Additional information

No response

jcwillox commented 1 year ago

You're backups may just be to large, see this section of the wiki https://jcwillox.github.io/hass-auto-backup/home-assistant-supervised/#stability-timeouts

66krieger commented 1 year ago

Thank you. my backups are increasing in size by 3.4 GB, the backups themselves seem fine, i'll try to change the settings and will report back

66krieger commented 1 year ago

Solved: The duration of the backup is now 43 minutes for 3.4 GB Size. I have set the backup timeout from 30 to 60 minutes and am now getting positive/successful feedback from the backup result.