{"record":{"id":"34ad08f548e0c6d8","repo":"home-assistant/core","slug":"auth-error","errorCode":"auth_error","errorMessage":"Authentication failed for {entry}, please update your API key","messagePattern":"Authentication failed for (.+?), please update your API key","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/accuweather/coordinator.py","lineNumber":93,"sourceCode":"            config_entry=config_entry,\n            name=f\"{name} (observation)\",\n            update_interval=UPDATE_INTERVAL_OBSERVATION,\n        )\n\n    @override\n    async def _async_update_data(self) -> dict[str, Any]:\n        \"\"\"Update data via library.\"\"\"\n        try:\n            async with timeout(10):\n                result = await self.accuweather.async_get_current_conditions()\n        except EXCEPTIONS as error:\n            raise UpdateFailed(\n                translation_domain=DOMAIN,\n                translation_key=\"current_conditions_update_error\",\n                translation_placeholders={\"error\": repr(error)},\n            ) from error\n        except InvalidApiKeyError as err:\n            raise ConfigEntryAuthFailed(\n                translation_domain=DOMAIN,\n                translation_key=\"auth_error\",\n                translation_placeholders={\"entry\": self.config_entry.title},\n            ) from err\n\n        _LOGGER.debug(\"Requests remaining: %d\", self.accuweather.requests_remaining)\n\n        return result\n\n\nclass AccuWeatherForecastDataUpdateCoordinator(\n    TimestampDataUpdateCoordinator[list[dict[str, Any]]]\n):\n    \"\"\"Base class for AccuWeather forecast.\"\"\"\n\n    config_entry: AccuWeatherConfigEntry\n\n    def __init__(","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/accuweather/coordinator.py#L75-L111","documentation":"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.","triggerScenarios":"accuweather.async_get_current_conditions() raises accuweather.InvalidApiKeyError, i.e. the API key stored in the config entry is rejected (401) by AccuWeather.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from accuweather import AccuWeather\n\n# exercise the key once at setup before enabling polling:\ntry:\n    await accuweather.async_get_current_conditions()\nexcept InvalidApiKeyError:\n    # immediately start reauth instead of failing per-update","typeGuard":null,"tryCatchPattern":"except InvalidApiKeyError as err:\n    raise ConfigEntryAuthFailed(\n        translation_domain=DOMAIN,\n        translation_key=\"auth_error\",\n        translation_placeholders={\"entry\": self.config_entry.title},\n    ) from err","preventionTips":["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"],"tags":["config-entry","auth","api-key","accuweather"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}