mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-08-18 02:43:18 +01:00
This is a corner case: a locally-built app whose container image went missing for some external reason and which is also detached from its store, e.g. its local source folder was removed. There is no normal Supervisor command that produces this combination -- rebuild removes the image before rebuilding, but it is rejected for detached apps, so it cannot leave a detached app without an image. The image loss here came from outside Supervisor's normal flow. Such an app cannot be rebuilt: there is no source. App.load still surfaced a MISSING_IMAGE repair with an EXECUTE_REPAIR suggestion for it, and the resolution autofix loop then tried to rebuild it. That dead-ends in App.path_location, which raises for a detached app, crashing the autofix with an unhandled exception. Don't create the rebuild repair when the app is detached. The detached-app check already surfaces a DETACHED_ADDON_REMOVED issue with an EXECUTE_REMOVE suggestion for these apps (the built-in local repository is always loaded), so the user is offered removal instead of a repair that can never succeed. Also guard the repair fixup itself against a detached build app. With the App.load change this is only reachable via a race: the repair is created while the app is attached and the app detaches before the autofix runs (or between its retries). Skip gracefully there too rather than throwing, mirroring the is_detached guards already in AppManager.update/rebuild. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>