home-assistant/core · error · ConfigEntryNotReady

invalid_bucket_name

Error message

invalid_bucket_name

What it means

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.

Source

Thrown at homeassistant/components/backblaze_b2/__init__.py:72

    try:
        bucket = await hass.async_add_executor_job(_authorize_and_get_bucket_sync)
    except exception.Unauthorized as err:
        raise ConfigEntryAuthFailed(
            translation_domain=DOMAIN,
            translation_key="invalid_credentials",
        ) from err
    except exception.RestrictedBucket as err:
        create_bucket_access_restricted_issue(hass, entry, err.bucket_name)
        raise ConfigEntryNotReady(
            translation_domain=DOMAIN,
            translation_key="restricted_bucket",
            translation_placeholders={
                "restricted_bucket_name": err.bucket_name,
            },
        ) from err
    except exception.NonExistentBucket as err:
        create_bucket_not_found_issue(hass, entry, entry.data[CONF_BUCKET])
        raise ConfigEntryNotReady(
            translation_domain=DOMAIN,
            translation_key="invalid_bucket_name",
        ) from err
    except exception.BadRequest as err:
        raise ConfigEntryNotReady(
            translation_domain=DOMAIN,
            translation_key="bad_request",
            translation_placeholders={"error_message": str(err)},
        ) from err
    except (
        exception.B2ConnectionError,
        exception.B2RequestTimeout,
        exception.ConnectionReset,
    ) as err:
        raise ConfigEntryNotReady(
            translation_domain=DOMAIN,
            translation_key="cannot_connect",
        ) from err

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Check the exact bucket name (case-sensitive) in the Backblaze console and fix it via reconfigure
  2. Create the bucket in B2 if it does not exist
  3. If the key is bucket-restricted, verify it points at the right bucketId — a mismatched restriction can look like a missing bucket
Defensive patterns

Strategy: validation

Validate before calling

# config-flow style pre-check
import re
assert re.fullmatch(r'[a-zA-Z0-9-]{6,50}', bucket_name), "invalid bucket name"
buckets = [b.name for b in b2_api.list_buckets()]
if bucket_name not in buckets:
    # create it or reject the config early

Type guard

import b2sdk.v2.exception as b2exc

def is_nonexistent_bucket(err: BaseException) -> bool:
    return isinstance(err, b2exc.NonExistentBucket)

Try / catch

except exception.NonExistentBucket as err:
    create_bucket_not_found_issue(hass, entry, entry.data[CONF_BUCKET])
    raise ConfigEntryNotReady(translation_domain=DOMAIN, translation_key="invalid_bucket_name") from err

Prevention

When it happens

Trigger: entry.data[CONF_BUCKET] names a bucket that does not exist in the authorized account; b2sdk lists/looks up buckets and raises NonExistentBucket.

Common situations: Typo in bucket name during setup, bucket deleted, app key restrictions hiding the bucket (appears nonexistent), wrong B2 account credentials.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/7faccc371f98342a. Report an issue: GitHub.