Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backups failed with BackupManager object has no attribute 'remove_backup' #160

Closed
ccMatrix opened this issue Nov 7, 2024 · 3 comments · Fixed by #161
Closed

Backups failed with BackupManager object has no attribute 'remove_backup' #160

ccMatrix opened this issue Nov 7, 2024 · 3 comments · Fixed by #161
Labels

Comments

@ccMatrix
Copy link
Contributor

ccMatrix commented Nov 7, 2024

The problem

Automatic backups are no longer working with Home Assistant 2024.11.0. The automatic backup fails with AttributeError: 'BackupManager' object has no attribute 'remove_backup'

What version of Auto Backup has the issue?

1.5.0

What version of Home Assistant are you running?

Home Assistant 2024.11.0

What type of installation are you running?

Home Assistant Core

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

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-11-07 08:57:40.451 ERROR (MainThread) [homeassistant.components.automation.automatic_backups] While executing automation automation.automatic_backups
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 743, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1081, in _async_if_step
    await self._async_run_script(if_data["if_else"])
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1274, in _async_run_script
    result = await self._async_run_long_action(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1075, in _async_if_step
    await self._async_run_script(if_data["if_then"])
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1274, in _async_run_script
    result = await self._async_run_long_action(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/auto_backup/__init__.py", line 193, in async_service_handler
    await auto_backup.async_create_backup(data)
  File "/config/custom_components/auto_backup/__init__.py", line 379, in async_create_backup
    await self.purge_backups()
  File "/config/custom_components/auto_backup/__init__.py", line 463, in purge_backups
    if await self._purge_snapshot(slug)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/auto_backup/__init__.py", line 482, in _purge_snapshot
    await self._handler.remove_backup(slug)
  File "/config/custom_components/auto_backup/handlers.py", line 224, in remove_backup
    await self._manager.remove_backup(slug)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'BackupManager' object has no attribute 'remove_backup'

Additional information

From what I could find, there were some changes to the BackupManager object in home-assistant/core@a14cb13#diff-a8336d653d0b63b1809369cd73a4de8d4c88c24d2c7b2dbad6481202c56d8706L35

The methods were moved e.g. remove_backup to async_remove_backup which of course leads to these errors since the object changed.

@Tazmanian79
Copy link

Can confirm, I have the same error.

@1mfaasj
Copy link

1mfaasj commented Nov 8, 2024

here the same issue

Copy link

github-actions bot commented Nov 9, 2024

🎉 This issue has been resolved in version 1.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants