{"record":{"id":"c59fbdd3623fcd09","repo":"home-assistant/core","slug":"failed-to-connect-c59fbd","errorCode":null,"errorMessage":"Failed to connect","messagePattern":"Failed to connect","errorType":"exception","errorClass":"UpdateFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/airos/coordinator.py","lineNumber":66,"sourceCode":"    airos_device: AirOSDeviceDetect,\n    update_method: Callable[[], Awaitable[T]],\n) -> T:\n    \"\"\"Fetch data from AirOS device.\"\"\"\n    try:\n        await airos_device.login()\n        return await update_method()\n    except AirOSConnectionAuthenticationError as err:\n        _LOGGER.exception(\"Error authenticating with airOS device\")\n        raise ConfigEntryAuthFailed(\n            translation_domain=DOMAIN, translation_key=\"invalid_auth\"\n        ) from err\n    except (\n        AirOSConnectionSetupError,\n        AirOSDeviceConnectionError,\n        TimeoutError,\n    ) as err:\n        _LOGGER.error(\"Error connecting to airOS device: %s\", err)\n        raise UpdateFailed(\n            translation_domain=DOMAIN,\n            translation_key=\"cannot_connect\",\n        ) from err\n    except AirOSDataMissingError as err:\n        _LOGGER.error(\"Expected data not returned by airOS device: %s\", err)\n        raise UpdateFailed(\n            translation_domain=DOMAIN,\n            translation_key=\"error_data_missing\",\n        ) from err\n\n\nclass AirOSDataUpdateCoordinator(DataUpdateCoordinator[AirOSDataDetect]):\n    \"\"\"Class to manage fetching AirOS status data from single endpoint.\"\"\"\n\n    config_entry: AirOSConfigEntry\n\n    def __init__(\n        self,","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/airos/coordinator.py#L48-L84","documentation":"UpdateFailed raised by the airos data fetch helper when connecting to the airOS device fails at setup, during the device connection, or times out. It signals a transient or persistent connectivity problem; Home Assistant will retry the coordinator update according to its backoff schedule and mark entities unavailable in the meantime.","triggerScenarios":"airos_device.login() or the update method raises AirOSConnectionSetupError (HTTP session/aiohttp client setup failure), AirOSDeviceConnectionError (device refused/dropped the connection), or TimeoutError (request exceeded the client timeout).","commonSituations":"Device offline or powered off, wrong host/port in config, firewall blocking the management IP, slow device under load causing timeouts, or DNS resolution failure for the configured hostname.","solutions":["Confirm the device is powered on and its web UI loads at the configured address.","Ping the device or curl its web interface from the Home Assistant host to rule out network/firewall issues.","Reserve the device IP in DHCP or correct the host in the config entry.","If timeouts dominate, reduce network load or check for a flaky wireless link to the device.","Review logs: the underlying err message distinguishes setup vs connection vs timeout."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import asyncio\n\nasync def airos_reachable(host: str, timeout: float = 5.0) -> bool:\n    try:\n        _, writer = await asyncio.wait_for(asyncio.open_connection(host, 443), timeout)\n        writer.close()\n        return True\n    except (OSError, TimeoutError):\n        return False","typeGuard":"def is_airos_connect_update_failed(err: Exception) -> bool:\n    return isinstance(err, UpdateFailed) and getattr(err, \"translation_key\", None) == \"cannot_connect\"","tryCatchPattern":"try:\n        await coordinator.async_config_entry_first_refresh()\nexcept ConfigEntryNotReady:\n    # UpdateFailed during first refresh becomes NotReady: HA retries with backoff\n    raise","preventionTips":["Reserve the device IP in DHCP before adding the integration.","Monitor the device with a simple availability check (ping/binary sensor) to catch outages early.","Ensure the management port is open on any firewall between Home Assistant and the device."],"tags":["home-assistant","airos","network","timeout","coordinator"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}