{"record":{"id":"21d79211ca312de6","repo":"home-assistant/core","slug":"auth-expired-21d792","errorCode":null,"errorMessage":"auth_expired","messagePattern":"auth_expired","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"critical","filePath":"homeassistant/components/anglian_water/coordinator.py","lineNumber":83,"sourceCode":"        self.api = api\n\n    @override\n    async def _async_update_data(self) -> None:\n        \"\"\"Update data from Anglian Water's API.\"\"\"\n        try:\n            await self.api.update(self.config_entry.data[CONF_ACCOUNT_NUMBER])\n            await self._insert_statistics()\n        except ConsentRequiredError as err:\n            async_create_consent_required_issue(\n                self.hass, self.config_entry.data[CONF_ACCOUNT_NUMBER]\n            )\n            raise UpdateFailed(\n                translation_domain=DOMAIN,\n                translation_key=\"consent_required\",\n                retry_after=900.0,\n            ) from err\n        except (ExpiredAccessTokenError, InvalidGrantError) as err:\n            raise ConfigEntryAuthFailed(\n                translation_domain=DOMAIN,\n                translation_key=\"auth_expired\",\n            ) from err\n        except UnknownEndpointError as err:\n            raise UpdateFailed(\n                translation_domain=DOMAIN,\n                translation_key=\"service_unavailable\",\n                retry_after=60.0,\n            ) from err\n        else:\n            async_delete_consent_required_issue(\n                self.hass, self.config_entry.data[CONF_ACCOUNT_NUMBER]\n            )\n\n    async def _insert_statistics(self) -> None:\n        \"\"\"Insert statistics for water meters into Home Assistant.\"\"\"\n        for meter in self.api.meters.values():\n            id_prefix = (","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/anglian_water/coordinator.py#L65-L101","documentation":"Raised as ConfigEntryAuthFailed (translation auth_expired) from the coordinator when api.update() raises ExpiredAccessTokenError or InvalidGrantError during a refresh: the refresh token that worked at setup has since been revoked or expired. HA transitions the entry into reauth-needed, halts coordinator retries, and prompts the user to log in again.","triggerScenarios":"api.update() mid-session receiving invalid_grant from the Anglian Water IdP — token revoked server-side, password reset, or a concurrent client consumed the rotating refresh token.","commonSituations":"Password changes after the entry was configured; two HA instances or a re-imported backup using the same token; provider-side session invalidation.","solutions":["Complete the re-auth flow on the integration entry.","Ensure only one HA instance uses these Anglian Water credentials.","If restoring from backup, re-authenticate after restore — the old refresh token was already used."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"ConfigEntryAuthFailed stops coordinator retries and opens reauth — drive the reauth flow; do not catch and retry in custom wrappers.","preventionTips":["Never share the account across instances or restored backups.","Expect reauth after provider-side password/token resets."],"tags":["auth","oauth","water","reauth","config-entry-auth-failed"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}