{"record":{"id":"2ccc8e6c6aa12c61","repo":"home-assistant/core","slug":"authentication-failed-reauth-err","errorCode":null,"errorMessage":"Authentication failed: {reauth_err}","messagePattern":"Authentication failed: (.+?)","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/autoskope/coordinator.py","lineNumber":55,"sourceCode":"        )\n        self.api = api\n\n    @override\n    async def _async_update_data(self) -> dict[str, Vehicle]:\n        \"\"\"Fetch data from API endpoint.\"\"\"\n        try:\n            vehicles = await self.api.get_vehicles()\n            return {vehicle.id: vehicle for vehicle in vehicles}\n\n        except InvalidAuth:\n            # Attempt to re-authenticate using stored credentials\n            try:\n                await self.api.authenticate()\n                # Retry the request after successful re-authentication\n                vehicles = await self.api.get_vehicles()\n                return {vehicle.id: vehicle for vehicle in vehicles}\n            except InvalidAuth as reauth_err:\n                raise ConfigEntryAuthFailed(\n                    f\"Authentication failed: {reauth_err}\"\n                ) from reauth_err\n\n        except CannotConnect as err:\n            raise UpdateFailed(f\"Error communicating with API: {err}\") from err\n","sourceCodeStart":37,"sourceCodeEnd":61,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/autoskope/coordinator.py#L37-L61","documentation":"Raised as ConfigEntryAuthFailed by the Autoskope DataUpdateCoordinator when a periodic get_vehicles() call got InvalidAuth AND a re-authentication attempt with the stored credentials also raised InvalidAuth. It tells Home Assistant the stored credentials are permanently bad and the user must re-authenticate; the coordinator stops retrying.","triggerScenarios":"Sequence: get_vehicles() -> InvalidAuth (session/token expired), then api.authenticate() with entry.data credentials -> InvalidAuth again. Typical when the password was changed server-side after initial setup, so stored credentials can no longer obtain a session.","commonSituations":"Password rotated outside Home Assistant; account suspended; API changed its auth scheme in a library update; credentials truncated/whitespace-corrupted in config entry data.","solutions":["Complete the re-auth flow triggered by this error and update the password.","Confirm the credentials still work in the official Autoskope app.","If credentials are correct, update the Autoskope integration/library in case the auth endpoint changed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from homeassistant.exceptions import ConfigEntryAuthFailed\n\ntry:\n    data = await coordinator.async_refresh()\nexcept ConfigEntryAuthFailed:\n    # stored credentials are dead; direct the user to the re-auth flow and stop refreshing\n    start_reauth_flow(entry)","preventionTips":["Update the stored password in HA as part of any credential rotation.","Never swallow ConfigEntryAuthFailed in coordinator subclasses — it must reach the config entry machinery.","Log the reauth_err detail; it often distinguishes bad credentials from API changes."],"tags":["home-assistant","authentication","coordinator","autoskope"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}