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 err

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Verify the username/password against the device web interface login.
  2. Re-configure the airos config entry in Home Assistant (Settings > Devices & Services) so the re-auth flow captures fresh credentials.
  3. Check the logged traceback to confirm it is authentication and not a connection issue misclassified by the library.
  4. 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

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

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/e23d2c5b6773729c. Report an issue: GitHub.