home-assistant/core · error · ConfigEntryAuthFailed
auth_error
auth_error
Error message
Authentication failed for {entry}, please update your API key What it means
ConfigEntryAuthFailed raised by the AccuWeather observation coordinator when the library raises InvalidApiKeyError. This transitions the config entry into reauthentication state — the user must re-enter the API key; automatic retries stop.
Source
Thrown at homeassistant/components/accuweather/coordinator.py:93
config_entry=config_entry,
name=f"{name} (observation)",
update_interval=UPDATE_INTERVAL_OBSERVATION,
)
@override
async def _async_update_data(self) -> dict[str, Any]:
"""Update data via library."""
try:
async with timeout(10):
result = await self.accuweather.async_get_current_conditions()
except EXCEPTIONS as error:
raise UpdateFailed(
translation_domain=DOMAIN,
translation_key="current_conditions_update_error",
translation_placeholders={"error": repr(error)},
) from error
except InvalidApiKeyError as err:
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN,
translation_key="auth_error",
translation_placeholders={"entry": self.config_entry.title},
) from err
_LOGGER.debug("Requests remaining: %d", self.accuweather.requests_remaining)
return result
class AccuWeatherForecastDataUpdateCoordinator(
TimestampDataUpdateCoordinator[list[dict[str, Any]]]
):
"""Base class for AccuWeather forecast."""
config_entry: AccuWeatherConfigEntry
def __init__(View on GitHub (pinned to 58a3fdb3ea)
Solutions
- Open Settings → Devices & Services → AccuWeather → Reauthenticate (or delete and re-create the entry) with a valid key
- Verify the key at developer.accuweather.com and create a new one if revoked
- Copy the key carefully — no leading/trailing spaces
Defensive patterns
Strategy: try-catch
Validate before calling
from accuweather import AccuWeather
# exercise the key once at setup before enabling polling:
try:
await accuweather.async_get_current_conditions()
except InvalidApiKeyError:
# immediately start reauth instead of failing per-update Try / catch
except InvalidApiKeyError as err:
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN,
translation_key="auth_error",
translation_placeholders={"entry": self.config_entry.title},
) from err Prevention
- Validate API keys during config flow, not only during updates
- Raise ConfigEntryAuthFailed only for definitive auth failures
- Trim whitespace from user-supplied keys at config-flow time
When it happens
Trigger: accuweather.async_get_current_conditions() raises accuweather.InvalidApiKeyError, i.e. the API key stored in the config entry is rejected (401) by AccuWeather.
Common situations: API key revoked or expired, key pasted with whitespace/typo, free-tier key deleted from the AccuWeather developer portal, or wrong key copied from another account.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14).
Data as JSON: /api/errors/34ad08f548e0c6d8.
Report an issue: GitHub.