{"record":{"id":"7faccc371f98342a","repo":"home-assistant/core","slug":"invalid-bucket-name-7faccc","errorCode":null,"errorMessage":"invalid_bucket_name","messagePattern":"invalid_bucket_name","errorType":"exception","errorClass":"ConfigEntryNotReady","httpStatus":null,"severity":"error","filePath":"homeassistant/components/backblaze_b2/__init__.py","lineNumber":72,"sourceCode":"    try:\n        bucket = await hass.async_add_executor_job(_authorize_and_get_bucket_sync)\n    except exception.Unauthorized as err:\n        raise ConfigEntryAuthFailed(\n            translation_domain=DOMAIN,\n            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","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/backblaze_b2/__init__.py#L54-L90","documentation":"Raised as ConfigEntryNotReady (translation key invalid_bucket_name) when get_bucket_by_name fails with exception.NonExistentBucket. The configured bucket name does not exist in the account (or is not visible to these credentials). HA raises a repair issue with the bucket name.","triggerScenarios":"entry.data[CONF_BUCKET] names a bucket that does not exist in the authorized account; b2sdk lists/looks up buckets and raises NonExistentBucket.","commonSituations":"Typo in bucket name during setup, bucket deleted, app key restrictions hiding the bucket (appears nonexistent), wrong B2 account credentials.","solutions":["Check the exact bucket name (case-sensitive) in the Backblaze console and fix it via reconfigure","Create the bucket in B2 if it does not exist","If the key is bucket-restricted, verify it points at the right bucketId — a mismatched restriction can look like a missing bucket"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# config-flow style pre-check\nimport re\nassert re.fullmatch(r'[a-zA-Z0-9-]{6,50}', bucket_name), \"invalid bucket name\"\nbuckets = [b.name for b in b2_api.list_buckets()]\nif bucket_name not in buckets:\n    # create it or reject the config early","typeGuard":"import b2sdk.v2.exception as b2exc\n\ndef is_nonexistent_bucket(err: BaseException) -> bool:\n    return isinstance(err, b2exc.NonExistentBucket)","tryCatchPattern":"except exception.NonExistentBucket as err:\n    create_bucket_not_found_issue(hass, entry, entry.data[CONF_BUCKET])\n    raise ConfigEntryNotReady(translation_domain=DOMAIN, translation_key=\"invalid_bucket_name\") from err","preventionTips":["Validate bucket names (lowercase letters, digits, dashes; 6-50 chars) in the config flow","Offer a bucket picker from list_buckets() instead of free-text entry","Remember bucket-restricted keys hide other buckets as 'nonexistent'"],"tags":["backblaze","b2","config-entry","not-found"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}