From 4b1a82562c66dc322369dd3afb9c2c654d210cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Wed, 17 Dec 2025 23:01:28 +0100 Subject: [PATCH] Fix missing metadata of stopped add-ons after aiodocker migration (#6435) After the aiodocker migration in #6415 some add-ons may have been missing IP addresses because the metadata was retrieved for the container before it was started and network initialized. This manifested as some containers being unreachable through ingress (e.g. 'Ingress error: Cannot connect to host 0.0.0.0:8099'), especially if they have been started manually after Supervisor startup. To fix it, simply move retrieval of the container metadata (which is then persisted in DockerInterface._meta) to the end of the run method, where all attributes should have correct values. This is similar to the flow before the refactoring, where Container.reload() was called to update the metadata. --- supervisor/docker/manager.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/supervisor/docker/manager.py b/supervisor/docker/manager.py index d74ecd3f0..2c214cc61 100644 --- a/supervisor/docker/manager.py +++ b/supervisor/docker/manager.py @@ -530,18 +530,6 @@ class DockerAPI(CoreSysAttributes): f"Dockerd connection issue for {name}: {err}", _LOGGER.error ) from err - # Get container metadata - try: - container_attrs = await container.show() - except aiodocker.DockerError as err: - raise DockerAPIError( - f"Can't inspect new container {name}: {err}", _LOGGER.error - ) from err - except requests.RequestException as err: - raise DockerRequestError( - f"Dockerd connection issue for {name}: {err}", _LOGGER.error - ) from err - # Setup network and store container id in cidfile def setup_network_and_cidfile() -> None: # Write cidfile @@ -584,7 +572,18 @@ class DockerAPI(CoreSysAttributes): f"Dockerd connection issue for {name}: {err}", _LOGGER.error ) from err - # Return metadata + # Get container metadata after the container is started + try: + container_attrs = await container.show() + except aiodocker.DockerError as err: + raise DockerAPIError( + f"Can't inspect started container {name}: {err}", _LOGGER.error + ) from err + except requests.RequestException as err: + raise DockerRequestError( + f"Dockerd connection issue for {name}: {err}", _LOGGER.error + ) from err + return container_attrs async def pull_image(