home-assistant/core · error · ConfigEntryAuthFailed
Authentication with AirPatrol failed
Error message
Authentication with AirPatrol failed
What it means
ConfigEntryAuthFailed raised during AirPatrol data refresh when get_data() raises AirPatrolAuthenticationError twice: the first failure triggers a token refresh and a single retry, and if the retry also fails authentication, this error starts the re-auth flow with 'Authentication with AirPatrol failed'.
Source
Thrown at homeassistant/components/airpatrol/coordinator.py:56
try:
await self._setup_client()
except AirPatrolError as api_err:
raise UpdateFailed(
f"Error communicating with AirPatrol API: {api_err}"
) from api_err
@override
async def _async_update_data(self) -> dict[str, dict[str, Any]]:
"""Update unit data from AirPatrol API."""
return {unit_data["unit_id"]: unit_data for unit_data in await self._get_data()}
async def _get_data(self, retry: bool = False) -> list[dict[str, Any]]:
"""Fetch data from API."""
try:
return await self.api.get_data()
except AirPatrolAuthenticationError as auth_err:
if retry:
raise ConfigEntryAuthFailed(
"Authentication with AirPatrol failed"
) from auth_err
await self._update_token()
return await self._get_data(retry=True)
except AirPatrolError as err:
raise UpdateFailed(
f"Error communicating with AirPatrol API: {err}"
) from err
async def _update_token(self) -> None:
"""Refresh the AirPatrol API client and update the access token."""
session = async_get_clientsession(self.hass)
try:
self.api = await AirPatrolAPI.authenticate(
session,
self.config_entry.data[CONF_EMAIL],
self.config_entry.data[CONF_PASSWORD],
)View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Confirm the AirPatrol account email/password still work in the official app.
- Complete the Home Assistant re-authentication prompt for the airpatrol entry.
- If credentials are correct and it still fails, check for a library/API version mismatch and update the integration.
- Check logs for the chained auth_err to see the API's rejection reason.
Defensive patterns
Strategy: try-catch
Type guard
def is_airpatrol_auth_failed(err: Exception) -> bool:
return isinstance(err, ConfigEntryAuthFailed) and "AirPatrol" in str(err) Try / catch
try:
await coordinator.async_refresh()
except ConfigEntryAuthFailed:
# both retries rejected: re-enter credentials via re-auth flow; retrying with the same token is futile
await hass.config_entries.async_reload(entry.entry_id) Prevention
- Keep the AirPatrol password stable or update the Home Assistant entry immediately after changes.
- Treat a second consecutive auth failure as a credential problem, never as a transient network issue.
When it happens
Trigger: Expired/revoked access token where _update_token() re-authenticates with stored email/password but the password is now wrong, the account was deleted/locked, or the refreshed token is immediately rejected again (retry=True path).
Common situations: Password changed in the AirPatrol app after setup, account deactivated, or API token semantics changed by the provider so refresh tokens never validate.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Unable to deactivate the owner
- System generated users cannot enable multi-factor auth modul
- Authentication failed, please reauthenticate.
- Invalid authentication
- Authentication or connection failed during firmware update
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/d1531b627b4311c6.
Report an issue: GitHub.