Skip to content

Fix Core update rollback: delay image cleanup and fix missing rollback path#6726

Open
agners wants to merge 3 commits intomainfrom
delay-image-cleanup-on-core-upgrade
Open

Fix Core update rollback: delay image cleanup and fix missing rollback path#6726
agners wants to merge 3 commits intomainfrom
delay-image-cleanup-on-core-upgrade

Conversation

@agners
Copy link
Copy Markdown
Member

@agners agners commented Apr 10, 2026

Proposed change

Fix two issues with the Core update rollback flow:

  1. Old image cleaned up too early: The previous version's Docker
    image was removed inside _update() before the post-update health
    checks (frontend loaded and accessible). If the health checks failed
    and a rollback was triggered, the old image had to be re-downloaded.
    Moved the cleanup to after health checks pass.

  2. Missing rollback when get_config fails: When get_config()
    raised HomeAssistantError after the update, the code set
    error_state = True but immediately returned, skipping the rollback
    block. The other health check failure paths correctly fall through to
    the rollback logic; this was the only one that didn't.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:
  • Link to client library pull request:

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
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

agners and others added 3 commits April 10, 2026 18:09
Move the old Docker image cleanup from inside _update() to after the
post-update health checks (frontend loaded and accessible). This keeps
the previous version's image available locally when a rollback is
needed, avoiding a potentially slow re-download.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify that the old Docker image is cleaned up only after health checks
pass, and not when a rollback is triggered.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The early return after setting error_state skipped the rollback block,
leaving the system on a broken new version when the API stopped
responding after update. The other health check failure paths correctly
fall through to the rollback logic; this was the only one that didn't.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@agners agners added the bugfix A bug fix label Apr 10, 2026
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 this pull request may close these issues.

1 participant