{"record":{"id":"d53112abf925ee6b","repo":"home-assistant/core","slug":"cannot-connect-d53112","errorCode":"cannot_connect","errorMessage":"Cannot connect to endpoint","messagePattern":"Cannot connect to endpoint","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"error","filePath":"homeassistant/components/aws_s3/__init__.py","lineNumber":59,"sourceCode":"        await client.head_bucket(Bucket=data[CONF_BUCKET])\n    except ClientError as err:\n        raise ConfigEntryError(\n            translation_domain=DOMAIN,\n            translation_key=\"invalid_credentials\",\n        ) from err\n    except ParamValidationError as err:\n        if \"Invalid bucket name\" in str(err):\n            raise ConfigEntryError(\n                translation_domain=DOMAIN,\n                translation_key=\"invalid_bucket_name\",\n            ) from err\n    except ValueError as err:\n        raise ConfigEntryError(\n            translation_domain=DOMAIN,\n            translation_key=\"invalid_endpoint_url\",\n        ) from err\n    except ConnectionError as err:\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"cannot_connect\",\n        ) from err\n\n    coordinator = S3DataUpdateCoordinator(\n        hass,\n        entry=entry,\n        client=client,\n    )\n    await coordinator.async_config_entry_first_refresh()\n    entry.runtime_data = coordinator\n\n    def notify_backup_listeners() -> None:\n        for listener in hass.data.get(DATA_BACKUP_AGENT_LISTENERS, []):\n            listener()\n\n    entry.async_on_unload(entry.async_on_state_change(notify_backup_listeners))\n","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/aws_s3/__init__.py#L41-L77","documentation":"Raised as ConfigEntryNotReady (translation_key cannot_connect) by aws_s3 when head_bucket raises a Python ConnectionError — the TCP connection to the S3 endpoint could not be established. Home Assistant marks setup as not-ready and retries with backoff; the entry is not permanently failed.","triggerScenarios":"head_bucket to the configured endpoint fails at the network layer: endpoint host down/wrong port, DNS resolution failure, firewall dropping the connection, MinIO container restarting, or packet loss causing connect timeouts.","commonSituations":"Local MinIO/NAS offline or rebooting; endpoint URL points to a wrong IP after DHCP change; HA in a container without access to the storage VLAN; AWS endpoint blocked by an egress firewall.","solutions":["Verify the endpoint is reachable from the HA host: curl -I http(s)://<endpoint>.","Fix the endpoint URL/port if the storage service moved (static IP or DNS name recommended).","Open outbound access to the endpoint in firewalls; for AWS ensure s3.<region>.amazonaws.com:443 is allowed.","No action needed for a transient outage — ConfigEntryNotReady retries automatically."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import socket\nfrom urllib.parse import urlparse\n\ndef endpoint_connectable(url: str, timeout: float = 3.0) -> bool:\n    p = urlparse(url or \"https://s3.amazonaws.com\")\n    port = p.port or (443 if p.scheme == \"https\" else 80)\n    try:\n        socket.create_connection((p.hostname, port), timeout=timeout).close()\n        return True\n    except OSError:\n        return False\n","typeGuard":null,"tryCatchPattern":"except ConnectionError as err:\n    raise ConfigEntryNotReady(translation_key=\"cannot_connect\") from err  # HA retries with backoff","preventionTips":["Give S3-compatible services (MinIO, NAS) static IPs or DNS names.","Check container networking/VLAN rules so HA can reach the storage endpoint.","Rely on ConfigEntryNotReady backoff rather than manual restart loops."],"tags":["home-assistant","aws","s3","network","retry","minio"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}