{"record":{"id":"f44a62ca107f479d","repo":"home-assistant/core","slug":"bad-request","errorCode":null,"errorMessage":"bad_request","messagePattern":"bad_request","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"error","filePath":"homeassistant/components/backblaze_b2/__init__.py","lineNumber":77,"sourceCode":"            translation_key=\"invalid_credentials\",\n        ) from err\n    except exception.RestrictedBucket as err:\n        create_bucket_access_restricted_issue(hass, entry, err.bucket_name)\n        raise ConfigEntryNotReady(\n            translation_domain=DOMAIN,\n            translation_key=\"restricted_bucket\",\n            translation_placeholders={\n                \"restricted_bucket_name\": err.bucket_name,\n            },\n        ) 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","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/backblaze_b2/__init__.py#L59-L95","documentation":"Raised as ConfigEntryNotReady (translation key bad_request) when the setup call fails with exception.BadRequest. B2 returned HTTP 400, meaning the request itself was malformed or rejected (bad parameters, invalid realm, corrupted request); the raw error text is passed as the error_message placeholder.","triggerScenarios":"authorize_account or get_bucket_by_name triggers a 400 from the B2 API — for example an invalid bucket name character, malformed key, or SDK/API version incompatibility producing a bad request.","commonSituations":"Unusual characters in bucket name, outdated b2sdk version against changed B2 API behavior, corrupted entry data after manual edits.","solutions":["Read the error_message placeholder text for the exact B2 complaint","Re-enter the config (reconfigure) to rebuild clean entry data","Update the b2sdk package / HA core so SDK and API versions align","Validate the bucket name against B2 naming rules (alphanumerics and dashes only)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"import b2sdk.v2.exception as b2exc\n\ndef is_bad_request(err: BaseException) -> bool:\n    return isinstance(err, b2exc.BadRequest)","tryCatchPattern":"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","preventionTips":["Surface the raw error_message to the user — B2 400s are self-describing","Keep b2sdk updated so request formats match the live B2 API","Never hand-edit config entry data for this integration"],"tags":["backblaze","b2","bad-request","config-entry"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}