{"record":{"id":"46dc7d14902d0aa8","repo":"home-assistant/core","slug":"cannot-connect-46dc7d","errorCode":null,"errorMessage":"cannot_connect","messagePattern":"cannot_connect","errorType":"exception","errorClass":"UpdateFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/apcupsd/coordinator.py","lineNumber":121,"sourceCode":"            name=self.data.name or \"APC UPS\",\n            hw_version=self.data.get(\"FIRMWARE\"),\n            sw_version=self.data.get(\"VERSION\"),\n            serial_number=self.data.serial_no,\n        )\n\n    @override\n    async def _async_update_data(self) -> APCUPSdData:\n        \"\"\"Fetch the latest status from APCUPSd.\n\n        Note that the result dict uses upper case for each resource, where our\n        integration uses lower cases as keys internally.\n        \"\"\"\n        async with asyncio.timeout(CONNECTION_TIMEOUT):\n            try:\n                data = await aioapcaccess.request_status(self._host, self._port)\n                return APCUPSdData(data)\n            except (OSError, asyncio.IncompleteReadError) as error:\n                raise UpdateFailed(\n                    translation_domain=DOMAIN,\n                    translation_key=\"cannot_connect\",\n                ) from error\n","sourceCodeStart":103,"sourceCodeEnd":125,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/apcupsd/coordinator.py#L103-L125","documentation":"UpdateFailed error (translation key 'cannot_connect') raised by the APCUPSd DataUpdateCoordinator when fetching status from the NUT/apcupsd daemon fails at the transport layer. It wraps OSError (connection refused, DNS failure, unreachable host) and asyncio.IncompleteReadError from aioapcaccess.request_status, and also fires when the overall asyncio.timeout(CONNECTION_TIMEOUT) elapses. It tells HA the coordinator could not reach the UPS daemon so the entry stays in a retry/reconnect state.","triggerScenarios":"aioapcaccess.request_status(host, port) raising ConnectionRefusedError/OSError (daemon down, wrong host/port, firewall), or the TCP connection opening but the response never completing (IncompleteReadError), or no response within CONNECTION_TIMEOUT seconds.","commonSituations":"apcupsd service not running on the target host; NIS port (default 3551) wrong or blocked by firewall; appliance/NAS rebooted; host configured by IP that changed via DHCP; SELinux blocking the connection.","solutions":["Verify apcupsd is running and listening: 'systemctl status apcupsd' and 'ss -tlnp | grep 3551' on the UPS host","Confirm the host and port in the config entry match the daemon's NISPORT (default 3551)","Test reachability from the HA host: 'nc <host> 3551' or 'telnet <host> 3551'","Open the port in the firewall / fix SELinux rules, then reload the integration to trigger a retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# From the HA host, check the NIS port before relying on the integration\n# nc -z -w3 <ups_host> 3551 && echo ok","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep apcupsd monitored (systemd auto-restart) on the UPS host","Prefer static IPs / DNS names for the UPS host","Periodically verify port 3551 reachability from the HA host"],"tags":["home-assistant","apcupsd","network","coordinator","connection-timeout"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}