{"record":{"id":"13ccc1c836966133","repo":"infiniflow/ragflow","slug":"unsupported-bucket-type-self-bucket-type","errorCode":null,"errorMessage":"Unsupported bucket type: {self.bucket_type}","messagePattern":"Unsupported bucket type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"common/data_source/blob_connector.py","lineNumber":118,"sourceCode":"                pass\n\n            else:\n                raise ConnectorMissingCredentialError(\"Unsupported S3 authentication method\")\n\n        elif self.bucket_type == BlobType.GOOGLE_CLOUD_STORAGE:\n            if not all(credentials.get(key) for key in [\"access_key_id\", \"secret_access_key\"]):\n                raise ConnectorMissingCredentialError(\"Google Cloud Storage\")\n\n        elif self.bucket_type == BlobType.OCI_STORAGE:\n            if not all(credentials.get(key) for key in [\"namespace\", \"region\", \"access_key_id\", \"secret_access_key\"]):\n                raise ConnectorMissingCredentialError(\"Oracle Cloud Infrastructure\")\n\n        elif self.bucket_type == BlobType.S3_COMPATIBLE:\n            if not all(credentials.get(key) for key in [\"endpoint_url\", \"aws_access_key_id\", \"aws_secret_access_key\", \"addressing_style\"]):\n                raise ConnectorMissingCredentialError(\"S3 Compatible Storage\")\n\n        else:\n            raise ValueError(f\"Unsupported bucket type: {self.bucket_type}\")\n\n        # Create S3 client\n        self.s3_client = create_s3_client(self.bucket_type, credentials, self.european_residency)\n\n        # Detect bucket region (only important for S3)\n        if self.bucket_type == BlobType.S3:\n            self.bucket_region = detect_bucket_region(self.s3_client, self.bucket_name)\n\n        return None\n\n    def _build_document_from_obj(\n        self,\n        obj: dict[str, Any],\n        filename_counts: dict[str, int],\n    ) -> Optional[Document]:\n        \"\"\"Materialize a Document for one S3 object, downloading its body.\"\"\"\n        key = obj[\"Key\"]\n        file_name = os.path.basename(key)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/blob_connector.py#L100-L136","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check common/data_source/config.py for the BlobType enum and use one of the supported values in connector config","If you added a new BlobType member, add a matching credential-validation branch in load_credentials","Verify the deployed code version matches the config schema — a newer config with an older worker produces this mismatch","Log/inspect self.bucket_type at connector construction to catch bad values as early as possible"],"exampleFix":"// before\nconnector = BlobStorageConnector(bucket_type='wasabi', bucket_name='docs')\n// after\n# use a supported BlobType value\nconnector = BlobStorageConnector(bucket_type='s3_compatible', bucket_name='docs')\n# and pass endpoint_url + addressing_style for Wasabi\nconnector.load_credentials({\n    'endpoint_url': 'https://s3.us-east-2.wasabisys.com',\n    'aws_access_key_id': key,\n    'aws_secret_access_key': secret,\n    'addressing_style': 'path',\n})","handlingStrategy":"validation","validationCode":"from common.data_source.config import BlobType\ntry:\n    BlobType(bucket_type)\nexcept ValueError:\n    raise ValueError(f'bucket_type must be one of {[t.value for t in BlobType]}')","typeGuard":"from common.data_source.config import BlobType\n\ndef is_supported_bucket_type(v: str) -> bool:\n    try:\n        BlobType(v)\n        return True\n    except ValueError:\n        return False","tryCatchPattern":"try:\n    connector = BlobStorageConnector(bucket_type=bt, bucket_name=bn)\n    connector.load_credentials(creds)\nexcept ValueError as e:\n    if 'Unsupported bucket type' in str(e):\n        raise ConfigError('enum/validation version mismatch — update the worker or the config') from e\n    raise","preventionTips":["Pin the connector-worker and config-schema versions together so BlobType and load_credentials branches cannot drift","When adding a BlobType member, add its load_credentials branch and credential requirements in the same change"],"tags":["configuration","enum","blob-storage","version-mismatch"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}