home-assistant/core · error · ConfigEntryAuthFailed
Invalid authentication
Error message
Invalid authentication
What it means
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.
Source
Thrown at homeassistant/components/airos/coordinator.py:57
"""Data for AirOS config entry."""
status: AirOSDataUpdateCoordinator
firmware: AirOSFirmwareUpdateCoordinator | None
session: ClientSession
owns_session: bool = False
async def async_fetch_airos_data(
airos_device: AirOSDeviceDetect,
update_method: Callable[[], Awaitable[T]],
) -> T:
"""Fetch data from AirOS device."""
try:
await airos_device.login()
return await update_method()
except AirOSConnectionAuthenticationError as err:
_LOGGER.exception("Error authenticating with airOS device")
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN, translation_key="invalid_auth"
) from err
except (
AirOSConnectionSetupError,
AirOSDeviceConnectionError,
TimeoutError,
) as err:
_LOGGER.error("Error connecting to airOS device: %s", err)
raise UpdateFailed(
translation_domain=DOMAIN,
translation_key="cannot_connect",
) from err
except AirOSDataMissingError as err:
_LOGGER.error("Expected data not returned by airOS device: %s", err)
raise UpdateFailed(
translation_domain=DOMAIN,
translation_key="error_data_missing",
) from errView on GitHub (pinned to 58a3fdb3ea)
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.
Defensive patterns
Strategy: validation
Type guard
def is_airos_auth_failed(err: Exception) -> bool:
return isinstance(err, ConfigEntryAuthFailed) Try / catch
try:
await async_fetch_airos_data(device, update)
except ConfigEntryAuthFailed:
# credentials rejected: prompt re-auth, do NOT retry with same credentials
await hass.config_entries.async_reload(entry.entry_id) Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Authentication or connection failed during firmware update
- Authentication failed, please check credentials
- authentication_failed
- Credential is already linked to a user
- Unable to deactivate the owner
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/e23d2c5b6773729c.
Report an issue: GitHub.