{"record":{"id":"e23d2c5b6773729c","repo":"home-assistant/core","slug":"invalid-authentication","errorCode":null,"errorMessage":"Invalid authentication","messagePattern":"Invalid authentication","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/airos/coordinator.py","lineNumber":57,"sourceCode":"    \"\"\"Data for AirOS config entry.\"\"\"\n\n    status: AirOSDataUpdateCoordinator\n    firmware: AirOSFirmwareUpdateCoordinator | None\n    session: ClientSession\n    owns_session: bool = False\n\n\nasync def async_fetch_airos_data(\n    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","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/airos/coordinator.py#L39-L75","documentation":"ConfigEntryAuthFailed raised by the airos data fetch helper when the airOS library raises AirOSConnectionAuthenticationError during login. It tells Home Assistant the stored credentials are invalid, which starts the re- authentication flow for the config entry. The full exception is logged with _LOGGER.exception before re-raising.","triggerScenarios":"airos_device.login() raises AirOSConnectionAuthenticationError: wrong username or password in the config entry, password changed on the device, account locked/disabled, or the device requiring a different authentication scheme than the library implements.","commonSituations":"Password rotated on the Ubiquiti device but not in Home Assistant, credentials entered with trailing whitespace during setup, or a firmware upgrade that changed the login endpoint/cookie behavior.","solutions":["Verify the username/password against the device web interface login.","Re-configure the airos config entry in Home Assistant (Settings > Devices & Services) so the re-auth flow captures fresh credentials.","Check the logged traceback to confirm it is authentication and not a connection issue misclassified by the library.","Update the integration if a firmware change broke the login handshake."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":"def is_airos_auth_failed(err: Exception) -> bool:\n    return isinstance(err, ConfigEntryAuthFailed)","tryCatchPattern":"try:\n    await async_fetch_airos_data(device, update)\nexcept ConfigEntryAuthFailed:\n    # credentials rejected: prompt re-auth, do NOT retry with same credentials\n    await hass.config_entries.async_reload(entry.entry_id)","preventionTips":["Validate credentials by logging into the device web UI before saving the config entry.","Avoid trailing whitespace when entering usernames/passwords in the config flow.","When rotating device passwords, update the Home Assistant entry in the same change window."],"tags":["home-assistant","airos","authentication","config-entry"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}