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

AutoBackup not working on HA Core since HA 2025.1 #178

Closed
MatteoR23 opened this issue Jan 4, 2025 · 15 comments · Fixed by #182
Closed

AutoBackup not working on HA Core since HA 2025.1 #178

MatteoR23 opened this issue Jan 4, 2025 · 15 comments · Fixed by #182
Labels
bug Something isn't working released

Comments

@MatteoR23
Copy link

The problem

Every backup fails with HA 2025.1, since backup back-end has been changed from scratch

What version of Auto Backup has the issue?

1.5.3

What version of Home Assistant are you running?

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

No response

Additional information

No response

@h3x89
Copy link

h3x89 commented Jan 4, 2025

Additional Information: AutoBackup Failing on HA 2025.1

I am experiencing the same issue as described in this thread after updating Home Assistant to version 2025.1.0. Below are the details of my setup and relevant error logs:

System Information:

  • Home Assistant Version: 2025.1.0 (Core), Frontend: 20250103.0
  • AutoBackup Version: 1.5.3
  • Installation Type: Home Assistant Core (Docker)

Error Details:

During the backup process, the following error appears in the logs:

Logger: custom_components.auto_backup
Source: custom_components/auto_backup/__init__.py:444
Integration: Auto Backup
Error during backup. Unable to patch `_generate_backup_contents` function.

Additionally, the tracebacks indicate the following errors:

  1. AttributeError: 'BackupManager' object has no attribute 'remove_backup'.
  2. Several instances of Unexpected error for call_service at pos 1.

Full traceback details:

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
  await getattr(self, handler)()
...
File "/config/custom_components/auto_backup/__init__.py", line 238, in purge_backups
  if await self._purge_snapshot(slug):
File "/config/custom_components/auto_backup/handlers.py", line 232, in remove_backup
  await self._manager.remove_backup(slug)
AttributeError: 'BackupManager' object has no attribute 'remove_backup'

Steps to Reproduce:

  1. Updated Home Assistant to version 2025.1.0.
  2. Attempted to create or manage backups via AutoBackup.

Observations:

  • The issue seems related to changes in the BackupManager class or its related functions, as the remove_backup attribute appears to no longer exist.
  • This might be linked to a recent overhaul of the backup backend in Home Assistant.

Request:

Could you please investigate compatibility between the AutoBackup integration and the updated Home Assistant backup backend? Let me know if additional logs or configurations would help!

Thank you for your support!

@jeroenterheerdt
Copy link

I'd honestly question if we still need this custom integration with the overhaul of built-in backups. I have disabled it for now to experiment with what HA offers out of the box.

@MatteoR23
Copy link
Author

MatteoR23 commented Jan 4, 2025

What I miss tbh are events, that I use to send a command to shell to upload backups to the cloud. I suppose that until there's no alternatives, I would appreciate to have this custom integration working

@blacknell
Copy link

I think the generational controls offered by this addon are essential.

@jcwillox
Copy link
Owner

jcwillox commented Jan 5, 2025

The implementation for HA core is a bit hacky (uses a monkey patch) so it can break with updates, but shouldn't be too hard to get working again (hopefully).

The HA OS or supervised implementation is still working.

As for if this is still needed, depends on the use case, Auto Backup is still more powerful and, importantly for me at least, supports generational backup schemes.

I think for some the internal support will be enough, and hopefully they'll continue to add more features like multiple automatic backup configurations, to support generational backups.

@jcwillox jcwillox added the bug Something isn't working label Jan 5, 2025
@jcwillox jcwillox changed the title AutoBackup not working since HA 2025.1 AutoBackup not working on HA Core since HA 2025.1 Jan 5, 2025
@jcwillox
Copy link
Owner

jcwillox commented Jan 6, 2025

So, the fix was a bit more complex this time as they completely changed the backup logic in HA Core, but the new logic is much better and we no longer need any monkey patches which means the implemenation should be much more stable this time. I've still got a few more things to sort out and test but hopefully should release the fix tonight

jcwillox added a commit that referenced this issue Jan 6, 2025
* fixes backups not working for HA Core users on 2025.1.0
* adds native support for backup name
* adds support for backup password

Fixes: #178
jcwillox added a commit that referenced this issue Jan 6, 2025
* fixes backups not working for HA Core users on 2025.1.0
* adds native support for backup name
* adds support for backup password

Fixes: #178
@MatteoR23
Copy link
Author

Thank you so much for your effort

@ilexpl01
Copy link

ilexpl01 commented Jan 6, 2025

Hi, was the fix already implemented ? I have reloaded the integration but the isuue remains:

Logger: custom_components.auto_backup
Source: custom_components/auto_backup/init.py:444
integration: Auto Backup (documentation, issues)
First occurred: 11:26:00 (1 occurrences)
Last logged: 11:26:00

Error during backup. Unable to patch '_generate_backup_contents' function.

Copy link

github-actions bot commented Jan 6, 2025

🎉 This issue has been resolved in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ilexpl01
Copy link

ilexpl01 commented Jan 6, 2025

The release is not available right now:

image

@jcwillox
Copy link
Owner

jcwillox commented Jan 6, 2025

Hahah you were just too fast 😄, I wanted to write a bit of an update in the release notes (also update the docs which is why I didn't release this afternoon), so I created a draft release first, but it's published now, do let me know if the fix is working, seemed to work great in my tests.

Additionally password is now supported on HA core (allowing you to use both a custom password and home assistants new encryption key if you want), and name is now officially supported no more monkey-patching.

@ilexpl01
Copy link

ilexpl01 commented Jan 6, 2025

Seems to be running fine :)

image

GOOD JOB !

@jcwillox
Copy link
Owner

jcwillox commented Jan 6, 2025

Fantastic, thanks!

@MatteoR23
Copy link
Author

Lovely, thank you very much ☺️

@h3x89
Copy link

h3x89 commented Jan 6, 2025

Thank you so much for the quick upgrade—fantastic job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants