infiniflow/ragflow · error · ValueError

Unsupported bucket type: {self.bucket_type}

Error message

Unsupported bucket type: {self.bucket_type}

What it means

A ValueError with message 'Unsupported bucket type: {self.bucket_type}' raised in load_credentials when the bucket_type does not match any known BlobType branch (R2, S3, GOOGLE_CLOUD_STORAGE, OCI_STORAGE, S3_COMPATIBLE). Note the constructor already coerces bucket_type through BlobType(bucket_type), so reaching this branch means the value is a valid BlobType enum member that simply has no credential-validation branch here — or the enum gained a member without updating this method.

Source

Thrown at common/data_source/blob_connector.py:118

                pass

            else:
                raise ConnectorMissingCredentialError("Unsupported S3 authentication method")

        elif self.bucket_type == BlobType.GOOGLE_CLOUD_STORAGE:
            if not all(credentials.get(key) for key in ["access_key_id", "secret_access_key"]):
                raise ConnectorMissingCredentialError("Google Cloud Storage")

        elif self.bucket_type == BlobType.OCI_STORAGE:
            if not all(credentials.get(key) for key in ["namespace", "region", "access_key_id", "secret_access_key"]):
                raise ConnectorMissingCredentialError("Oracle Cloud Infrastructure")

        elif self.bucket_type == BlobType.S3_COMPATIBLE:
            if not all(credentials.get(key) for key in ["endpoint_url", "aws_access_key_id", "aws_secret_access_key", "addressing_style"]):
                raise ConnectorMissingCredentialError("S3 Compatible Storage")

        else:
            raise ValueError(f"Unsupported bucket type: {self.bucket_type}")

        # Create S3 client
        self.s3_client = create_s3_client(self.bucket_type, credentials, self.european_residency)

        # Detect bucket region (only important for S3)
        if self.bucket_type == BlobType.S3:
            self.bucket_region = detect_bucket_region(self.s3_client, self.bucket_name)

        return None

    def _build_document_from_obj(
        self,
        obj: dict[str, Any],
        filename_counts: dict[str, int],
    ) -> Optional[Document]:
        """Materialize a Document for one S3 object, downloading its body."""
        key = obj["Key"]
        file_name = os.path.basename(key)

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Check common/data_source/config.py for the BlobType enum and use one of the supported values in connector config
  2. If you added a new BlobType member, add a matching credential-validation branch in load_credentials
  3. Verify the deployed code version matches the config schema — a newer config with an older worker produces this mismatch
  4. Log/inspect self.bucket_type at connector construction to catch bad values as early as possible

Example fix

// before
connector = BlobStorageConnector(bucket_type='wasabi', bucket_name='docs')
// after
# use a supported BlobType value
connector = BlobStorageConnector(bucket_type='s3_compatible', bucket_name='docs')
# and pass endpoint_url + addressing_style for Wasabi
connector.load_credentials({
    'endpoint_url': 'https://s3.us-east-2.wasabisys.com',
    'aws_access_key_id': key,
    'aws_secret_access_key': secret,
    'addressing_style': 'path',
})
Defensive patterns

Strategy: validation

Validate before calling

from common.data_source.config import BlobType
try:
    BlobType(bucket_type)
except ValueError:
    raise ValueError(f'bucket_type must be one of {[t.value for t in BlobType]}')

Type guard

from common.data_source.config import BlobType

def is_supported_bucket_type(v: str) -> bool:
    try:
        BlobType(v)
        return True
    except ValueError:
        return False

Try / catch

try:
    connector = BlobStorageConnector(bucket_type=bt, bucket_name=bn)
    connector.load_credentials(creds)
except ValueError as e:
    if 'Unsupported bucket type' in str(e):
        raise ConfigError('enum/validation version mismatch — update the worker or the config') from e
    raise

Prevention

When it happens

Trigger: Constructing BlobStorageConnector with a bucket_type string that BlobType accepts (e.g. a newly added enum member like 'azure' or 'observable') but for which load_credentials has no elif branch, then calling load_credentials. An invalid string such as 'foo' instead fails earlier, in __init__, at the BlobType(bucket_type) coercion with a different ValueError.

Common situations: Upgrading the codebase so BlobType gains a new provider but load_credentials was not extended; passing an unexpected enum value from connector config; typos usually surface at the constructor instead, so hitting this line points to a code/config version mismatch between enum and validation logic.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/13ccc1c836966133. Report an issue: GitHub.