1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-05-19 06:08:51 +01:00
Stefan Agner 309237a09e Refactor Supervisor network reattach path (#6760)
* Refactor Supervisor network reattach path

On fresh startup the Supervisor Docker network is created and known
plugin containers are re-attached. Plugin containers (observer, cli,
dns, audio) legitimately don't exist yet at that point, which produced
noisy ERROR lines before the exception was suppressed by the caller.

- attach_container_by_name() now raises DockerNotFound silently on 404
  and DockerError without implicit logging on other Docker API errors.
- _create_supervisor_network() iterates all managed containers in a
  single loop using explicit try/except, replacing three separate
  suppress(DockerError) blocks. Missing containers are logged at DEBUG,
  unexpected Docker errors at ERROR.
- Drop the alias argument on the reattach path. Docker adds the
  container name as an implicit network alias, and inter-container
  lookups go through ExtraHosts (/etc/hosts), not Docker DNS, so the
  explicit alias list was cosmetic and inconsistent with the
  first-create path anyway.
- Consolidate AUDIO_DOCKER_NAME, CLI_DOCKER_NAME, DNS_DOCKER_NAME in
  supervisor/const.py alongside the existing OBSERVER_DOCKER_NAME and
  SUPERVISOR_DOCKER_NAME constants.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Escalate network attach failures and handle Supervisor specially

Pull the Supervisor container out of the reattach loop since it must
exist — Supervisor is running the code. Any failure attaching it is a
real problem, so log at CRITICAL with exc_info so Sentry captures the
full traceback.

For plugin containers, escalate non-404 errors from ERROR to CRITICAL
(also with exc_info). A DockerError there typically means Docker
itself is unhealthy, which affects the whole system and warrants a
Sentry report. Missing plugin containers (DockerNotFound) continue to
be a DEBUG log since they're expected on fresh install.

Addresses review feedback on #6760.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:10:51 +02:00
2025-10-08 10:44:49 +02:00
2024-09-30 18:42:08 +02:00

Home Assistant Supervisor

First private cloud solution for home automation

Home Assistant (former Hass.io) is a container-based system for managing your Home Assistant Core installation and related applications. The system is controlled via Home Assistant which communicates with the Supervisor. The Supervisor provides an API to manage the installation. This includes changing network settings or installing and updating software.

Installation

Installation instructions can be found at https://home-assistant.io/getting-started.

Development

For small changes and bugfixes you can just follow this, but for significant changes open a RFC first. Development instructions can be found here.

Release

Releases are done in 3 stages (channels) with this structure:

  1. Pull requests are merged to the main branch.
  2. A new build is pushed to the dev stage.
  3. Releases are published.
  4. A new build is pushed to the beta stage.
  5. The stable.json file is updated.
  6. The build that was pushed to beta will now be pushed to stable.

Home Assistant - A project from the Open Home Foundation

Languages
Python 95.6%
JavaScript 4.3%