{"record":{"id":"a4372ebd77d35296","repo":"home-assistant/core","slug":"error-while-retrieving-data-err-a4372e","errorCode":null,"errorMessage":"Error while retrieving data: {err}","messagePattern":"Error while retrieving data: (.+?)","errorType":"exception","errorClass":"UpdateFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/airvisual_pro/coordinator.py","lineNumber":76,"sourceCode":"    @override\n    async def _async_update_data(self) -> dict[str, Any]:\n        \"\"\"Get data from the device.\"\"\"\n        try:\n            data = await self._node.async_get_latest_measurements()\n            data[\"history\"] = {}\n            if data[\"settings\"].get(\"follow_mode\") == \"device\":\n                history = await self._node.async_get_history(include_trends=False)\n                data[\"history\"] = history.get(\"measurements\", [])[-1]\n        except InvalidAuthenticationError as err:\n            raise ConfigEntryAuthFailed(\"Invalid Samba password\") from err\n        except NodeConnectionError as err:\n            if self.reload_task is None:\n                self.reload_task = self.hass.async_create_task(\n                    self.hass.config_entries.async_reload(self.config_entry.entry_id)\n                )\n            raise UpdateFailed(f\"Connection to Pro unit lost: {err}\") from err\n        except NodeProError as err:\n            raise UpdateFailed(f\"Error while retrieving data: {err}\") from err\n\n        return data\n","sourceCodeStart":58,"sourceCodeEnd":79,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/airvisual_pro/coordinator.py#L58-L79","documentation":"UpdateFailed raised as the catch-all when the AirVisual Pro node library raises NodeProError for reasons other than authentication or connection loss — typically malformed or unexpected data returned by the unit's Samba interface. The wrapped err text carries the library-level detail.","triggerScenarios":"The Samba read succeeds but parsing fails: the unit's CSV/JSON data file has an unexpected format (new firmware), the file is empty mid-write, or partial file contents are read while the unit rotates its log — raising NodeProError rather than a connection error.","commonSituations":"Firmware update changing the data file layout, reading a file mid-write producing truncated data, or unit storage issues producing corrupt files.","solutions":["Read the wrapped err message — it typically names the parse/format failure.","Power-cycle the AirVisual Pro unit to clear corrupt data files.","Check for firmware updates or known issues with the nodeairvisualpro library version in use.","If it started right after a firmware upgrade, report the format change upstream.","Reload the integration after the unit stabilizes."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"def is_airvisual_pro_data_error(err: Exception) -> bool:\n    return isinstance(err, UpdateFailed) and str(err).startswith(\"Error while retrieving data\")","tryCatchPattern":"try:\n    await coordinator.async_refresh()\nexcept UpdateFailed as err:\n    if not str(err).startswith(\"Connection to Pro unit lost\"):\n        # data-format/parse problem: power-cycle unit or check firmware; retrying rarely helps\n        _LOGGER.warning(\"AirVisual Pro data error: %s\", err)","preventionTips":["Power-cycle the Pro unit after firmware updates to regenerate clean data files.","Track nodeairvisualpro library updates when AirVisual ships firmware changes that alter data formats.","Escalate persistent parse errors upstream with the wrapped err detail instead of retry loops."],"tags":["home-assistant","airvisual-pro","samba","data-parsing"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}