{"record":{"id":"d89371b74bbadec8","repo":"home-assistant/core","slug":"cannot-connect-d89371","errorCode":null,"errorMessage":"cannot_connect","messagePattern":"cannot_connect","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"error","filePath":"homeassistant/components/backblaze_b2/__init__.py","lineNumber":87,"sourceCode":"        ) from err\n    except exception.NonExistentBucket as err:\n        create_bucket_not_found_issue(hass, entry, entry.data[CONF_BUCKET])\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"invalid_bucket_name\",\n        ) from err\n    except exception.BadRequest as err:\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"bad_request\",\n            translation_placeholders={\"error_message\": str(err)},\n        ) from err\n    except (\n        exception.B2ConnectionError,\n        exception.B2RequestTimeout,\n        exception.ConnectionReset,\n    ) as err:\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"cannot_connect\",\n        ) from err\n    except exception.MissingAccountData as err:\n        raise ConfigEntryAuthFailed(\n            translation_domain=DOMAIN,\n            translation_key=\"invalid_auth\",\n        ) from err\n\n    entry.runtime_data = bucket\n\n    def _async_notify_backup_listeners() -> None:\n        \"\"\"Notify any registered backup agent listeners.\"\"\"\n        _LOGGER.debug(\"Notifying backup listeners for entry %s\", entry.entry_id)\n        for listener in hass.data.get(DATA_BACKUP_AGENT_LISTENERS, []):\n            listener()\n\n    entry.async_on_unload(entry.async_on_state_change(_async_notify_backup_listeners))","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/backblaze_b2/__init__.py#L69-L105","documentation":"Raised as ConfigEntryNotReady (translation key cannot_connect) when setup fails with B2ConnectionError, B2RequestTimeout, or ConnectionReset. These are transport-level failures reaching api.backblazeb2.com; HA retries setup with exponential backoff.","triggerScenarios":"TCP/TLS connection failure to the B2 API (B2ConnectionError), request timing out (B2RequestTimeout), or a reset connection (ConnectionReset) during authorize_account/get_bucket_by_name.","commonSituations":"HA host offline or DNS failing, firewall blocking egress to backblazeb2.com, ISP/route flakiness, B2 service outage.","solutions":["Verify internet connectivity and DNS resolution for api.backblazeb2.com from the host","Allow outbound HTTPS (443) to Backblaze in firewall/proxy rules","Check Backblaze status page; transient errors self-heal via HA retries","If persistent on constrained networks, check MTU/keepalive settings causing resets"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import socket\nsocket.gethostbyname(\"api.backblazeb2.com\")  # quick reachability check","typeGuard":"import b2sdk.v2.exception as b2exc\n\ndef is_connection_error(err: BaseException) -> bool:\n    return isinstance(err, (b2exc.B2ConnectionError, b2exc.B2RequestTimeout, b2exc.ConnectionReset))","tryCatchPattern":"except (exception.B2ConnectionError, exception.B2RequestTimeout, exception.ConnectionReset) as err:\n    raise ConfigEntryNotReady(translation_domain=DOMAIN, translation_key=\"cannot_connect\") from err","preventionTips":["Allow outbound HTTPS to api.backblazeb2.com and the bucket's storage host","Rely on HA's ConfigEntryNotReady backoff for transient B2 connectivity issues","Monitor for chronic resets (MTU/VPN) rather than retrying blindly"],"tags":["backblaze","b2","network","transient"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}