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

Load hassio before backup at frontend stage #137067

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

jpbede
Copy link
Member

@jpbede jpbede commented Feb 1, 2025

Proposed change

backup is loaded already before stage 1 as a dependency of frontend while hassio is loaded after that at stage 1.
This leads to is_hassio returning False when backup is loaded, thinking we are a container/core install and preventing backups on Supervised or HAOS installs.

This PR ensures that hassio is also loaded at the frontend stage as well. Fyi hassio loaded: is a debug from me.

Before:

2025-02-01 10:13:10.825 INFO (MainThread) [homeassistant.bootstrap] Setting up frontend: {'backup', 'frontend'}
2025-02-01 10:13:10.841 DEBUG (MainThread) [homeassistant.components.backup] Scheduling next automatic delete of backups older than 7 in 1 day
2025-02-01 10:13:10.844 DEBUG (MainThread) [homeassistant.components.backup] Scheduling next automatic backup at 2025-02-02 05:02:57+01:00
2025-02-01 10:13:10.848 DEBUG (MainThread) [homeassistant.components.backup] Loaded 0 platforms
2025-02-01 10:13:10.848 DEBUG (MainThread) [homeassistant.components.backup] Loaded 0 agents
2025-02-01 10:13:10.849 DEBUG (MainThread) [homeassistant.components.backup] Loading backup agents for backup
2025-02-01 10:13:10.849 DEBUG (MainThread) [homeassistant.components.backup] hassio loaded: False
2025-02-01 10:13:10.849 DEBUG (MainThread) [homeassistant.components.backup] Backup platform backup loaded
2025-02-01 10:13:10.849 DEBUG (MainThread) [homeassistant.components.backup] 0 platforms loaded in total
2025-02-01 10:13:10.849 DEBUG (MainThread) [homeassistant.components.backup] 1 agents loaded in total
2025-02-01 10:13:10.849 DEBUG (MainThread) [homeassistant.components.backup] 1 local agents loaded in total
2025-02-01 10:13:10.858 INFO (MainThread) [homeassistant.bootstrap] Setting up recorder: {'recorder'}
2025-02-01 10:13:11.006 DEBUG (MainThread) [homeassistant.components.backup] Backup platform recorder loaded
2025-02-01 10:13:11.006 DEBUG (MainThread) [homeassistant.components.backup] 1 platforms loaded in total
2025-02-01 10:13:11.006 DEBUG (MainThread) [homeassistant.components.backup] 1 agents loaded in total
2025-02-01 10:13:11.006 DEBUG (MainThread) [homeassistant.components.backup] 1 local agents loaded in total
2025-02-01 10:13:11.006 INFO (MainThread) [homeassistant.bootstrap] Setting up debugger: {'debugpy'}
2025-02-01 10:13:11.006 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 1: {'http', 'websocket_api', 'zeroconf', 'webhook', 'network', 'api', 'hassio', 'cloud', 'ssdp', 'auth', 'dhcp', 'usb', 'bluetooth', 'repairs'}

After:

2025-02-01 10:23:12.487 INFO (MainThread) [homeassistant.bootstrap] Setting up frontend: {'backup', 'frontend', 'hassio'}
2025-02-01 10:23:12.715 DEBUG (MainThread) [homeassistant.components.backup] Scheduling next automatic delete of backups older than 7 in 1 day
2025-02-01 10:23:12.715 DEBUG (MainThread) [homeassistant.components.backup] Scheduling next automatic backup at 2025-02-02 05:03:52+01:00
2025-02-01 10:23:12.716 DEBUG (MainThread) [homeassistant.components.backup] Loading backup agents for hassio
2025-02-01 10:23:12.717 DEBUG (MainThread) [homeassistant.components.backup] Backup platform hassio loaded
2025-02-01 10:23:12.717 DEBUG (MainThread) [homeassistant.components.backup] 0 platforms loaded in total
2025-02-01 10:23:12.717 DEBUG (MainThread) [homeassistant.components.backup] 0 agents loaded in total
2025-02-01 10:23:12.717 DEBUG (MainThread) [homeassistant.components.backup] 0 local agents loaded in total
2025-02-01 10:23:12.717 DEBUG (MainThread) [homeassistant.components.backup] Loaded 0 platforms
2025-02-01 10:23:12.717 DEBUG (MainThread) [homeassistant.components.backup] Loaded 0 agents
2025-02-01 10:23:12.718 DEBUG (MainThread) [homeassistant.components.backup] Loading backup agents for backup
2025-02-01 10:23:12.718 DEBUG (MainThread) [homeassistant.components.backup] hassio loaded: True
2025-02-01 10:23:12.718 DEBUG (MainThread) [homeassistant.components.backup] Backup platform backup loaded
2025-02-01 10:23:12.718 DEBUG (MainThread) [homeassistant.components.backup] 0 platforms loaded in total
2025-02-01 10:23:12.718 DEBUG (MainThread) [homeassistant.components.backup] 0 agents loaded in total
2025-02-01 10:23:12.718 DEBUG (MainThread) [homeassistant.components.backup] 0 local agents loaded in total
2025-02-01 10:23:12.730 INFO (MainThread) [homeassistant.bootstrap] Setting up recorder: {'recorder'}
2025-02-01 10:23:12.862 DEBUG (MainThread) [homeassistant.components.backup] Backup platform recorder loaded
2025-02-01 10:23:12.862 DEBUG (MainThread) [homeassistant.components.backup] 1 platforms loaded in total
2025-02-01 10:23:12.863 DEBUG (MainThread) [homeassistant.components.backup] 2 agents loaded in total
2025-02-01 10:23:12.863 DEBUG (MainThread) [homeassistant.components.backup] 0 local agents loaded in total
2025-02-01 10:23:12.863 INFO (MainThread) [homeassistant.bootstrap] Setting up debugger: {'debugpy'}
2025-02-01 10:23:12.863 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 1: {'bluetooth', 'ssdp', 'http', 'usb', 'repairs', 'webhook', 'auth', 'network', 'cloud', 'api', 'zeroconf', 'websocket_api', 'dhcp', 'hassio'}

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@jpbede jpbede requested a review from a team as a code owner February 1, 2025 09:30
@home-assistant home-assistant bot added bugfix cla-signed core small-pr PRs with less than 30 lines. labels Feb 1, 2025
@joostlek joostlek added this to the 2025.2.0 milestone Feb 1, 2025
@emontnemery
Copy link
Contributor

emontnemery commented Feb 1, 2025

As a side note: We should either make after_dependencies work also for earlier stages than stage 2, or we should not allow them. having to do this manually is too fragile.

@jpbede jpbede merged commit 889fe05 into home-assistant:dev Feb 1, 2025
46 checks passed
@jpbede jpbede deleted the preload-hassio-backup branch February 1, 2025 10:43
@marc3k18
Copy link

marc3k18 commented Feb 1, 2025

It is fix in b4?

@smarthomejunkie
Copy link

It is fix in b4?

I think it's for the next b5

@marc3k18
Copy link

marc3k18 commented Feb 1, 2025

It is fix in b4?

I think it's for the next b5

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double drive (This System) for location backups Automatic backup failed
6 participants