{"record":{"id":"90d944f84b217d8e","repo":"home-assistant/core","slug":"error-communicating-with-api-err-90d944","errorCode":null,"errorMessage":"Error communicating with API: {err}","messagePattern":"Error communicating with API: (.+?)","errorType":"exception","errorClass":"UpdateFailed","httpStatus":null,"severity":"warning","filePath":"homeassistant/components/autoskope/coordinator.py","lineNumber":60,"sourceCode":"        \"\"\"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":42,"sourceCodeEnd":61,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/autoskope/coordinator.py#L42-L61","documentation":"Raised as UpdateFailed by the Autoskope DataUpdateCoordinator when get_vehicles() (or the post-reauth retry path's transient failures surface here) raises CannotConnect. UpdateFailed makes the DataUpdateCoordinator log the message and schedule the next normal refresh; entity state stays stale but the entry is not broken.","triggerScenarios":"A periodic refresh loses network connectivity to the Autoskope API mid-operation: timeout, dropped connection, DNS blip, or server 5xx mapped to CannotConnect by the API wrapper.","commonSituations":"Intermittent Wi-Fi on the HA host; Autoskope cloud brief outage; high latency causing timeouts on every scan; restrictive router/NAT dropping long-lived connections.","solutions":["If transient, no action — the coordinator retries on the next interval.","If persistent, test connectivity to the Autoskope API from the HA host and check for firewall/proxy interference.","Consider raising the coordinator's update interval or timeout if latency is consistently near the limit."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"from homeassistant.helpers.update_coordinator import UpdateFailed\n\ntry:\n    await coordinator.async_config_entry_first_refresh()\nexcept UpdateFailed as err:\n    # first refresh failed on connectivity; entities show unavailable and next interval retries\n    LOGGER.warning(\"Autoskope refresh failed: %s\", err)","preventionTips":["Expect transient CannotConnect during coordinator refresh; design UIs for 'unavailable' states.","Size the update interval above the API's typical latency to avoid constant timeouts.","Investigate only when UpdateFailed repeats every interval."],"tags":["home-assistant","network","coordinator","retry","autoskope"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}