{"record":{"id":"b749b231b8a91155","repo":"home-assistant/core","slug":"invalid-auth-b749b2","errorCode":null,"errorMessage":"invalid_auth","messagePattern":"invalid_auth","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/backblaze_b2/__init__.py","lineNumber":92,"sourceCode":"            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))\n\n    async def _periodic_issue_check(_now: Any) -> None:\n        \"\"\"Periodically check for repair issues.\"\"\"\n        await async_check_for_repair_issues(hass, entry)\n","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/backblaze_b2/__init__.py#L74-L110","documentation":"Raised as ConfigEntryAuthFailed (translation key invalid_auth) when setup fails with exception.MissingAccountData after authorization. b2sdk has no required account data (e.g. the auth response lacks account info such as an authorization token or account ID), so the session cannot proceed; HA triggers reauth.","triggerScenarios":"authorize_account succeeds at HTTP level but the stored account state is incomplete (missing authToken/accountId), typically when the response is inconsistent or the SDK account state was built from incompatible data.","commonSituations":"Rare b2sdk edge case after API changes, revoked/expired session mid-flow, mixing SDK versions with cached state in long-running processes.","solutions":["Re-enter credentials via the reauth flow to rebuild the account state","Update Home Assistant / b2sdk so the SDK matches current B2 API responses","If reproducible, capture b2sdk logs and report; verify the key is valid in the Backblaze console"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"import b2sdk.v2.exception as b2exc\n\ndef is_missing_account_data(err: BaseException) -> bool:\n    return isinstance(err, b2exc.MissingAccountData)","tryCatchPattern":"except exception.MissingAccountData as err:\n    raise ConfigEntryAuthFailed(translation_domain=DOMAIN, translation_key=\"invalid_auth\") from err","preventionTips":["Re-enter credentials cleanly via reauth to rebuild SDK account state","Keep HA/b2sdk versions current to avoid API response mismatches","Do not cache b2_api/account objects across credential changes"],"tags":["backblaze","b2","auth","config-entry"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}