{"record":{"id":"d4e545161be78f28","repo":"infiniflow/ragflow","slug":"no-bucket-name-was-provided-in-connector-settings","errorCode":null,"errorMessage":"No bucket name was provided in connector settings.","messagePattern":"No bucket name was provided in connector settings\\.","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/blob_connector.py","lineNumber":316,"sourceCode":"\n    def poll_source(self, start: SecondsSinceUnixEpoch, end: SecondsSinceUnixEpoch) -> GenerateDocumentsOutput:\n        \"\"\"Poll source to get documents\"\"\"\n        if self.s3_client is None:\n            raise ConnectorMissingCredentialError(\"Blob storage\")\n\n        start_datetime = datetime.fromtimestamp(start, tz=timezone.utc)\n        end_datetime = datetime.fromtimestamp(end, tz=timezone.utc)\n\n        for batch in self._yield_blob_objects(start_datetime, end_datetime):\n            yield batch\n\n    def validate_connector_settings(self) -> None:\n        \"\"\"Validate connector settings\"\"\"\n        if self.s3_client is None:\n            raise ConnectorMissingCredentialError(\"Blob storage credentials not loaded.\")\n\n        if not self.bucket_name:\n            raise ConnectorValidationError(\"No bucket name was provided in connector settings.\")\n\n        try:\n            # Lightweight validation step\n            self.s3_client.list_objects_v2(Bucket=self.bucket_name, Prefix=self.prefix, MaxKeys=1)\n\n        except Exception as e:\n            error_code = getattr(e, \"response\", {}).get(\"Error\", {}).get(\"Code\", \"\")\n            status_code = getattr(e, \"response\", {}).get(\"ResponseMetadata\", {}).get(\"HTTPStatusCode\")\n\n            # Common S3 error scenarios\n            if error_code in [\n                \"AccessDenied\",\n                \"InvalidAccessKeyId\",\n                \"SignatureDoesNotMatch\",\n            ]:\n                if status_code == 403 or error_code == \"AccessDenied\":\n                    raise InsufficientPermissionsError(f\"Insufficient permissions to list objects in bucket '{self.bucket_name}'. Please check your bucket policy and/or IAM policy.\")\n                if status_code == 401 or error_code == \"SignatureDoesNotMatch\":","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/blob_connector.py#L298-L334","documentation":"Raised by BlobStorageConnector.validate_connector_settings when self.bucket_name is falsy after construction. The constructor strips whitespace (bucket_name.strip()), so a name of '', '   ', or None produces this ConnectorValidationError. It fires before the lightweight list_objects_v2(MaxKeys=1) probe, so the user gets a clear config message instead of a confusing S3 error.","triggerScenarios":"Constructing the connector with bucket_name='' or a whitespace-only string (the strip() in __init__ reduces it to ''), or passing None. Then calling validate_connector_settings().","commonSituations":"Connector config form submitted with an empty bucket field; environment variable for the bucket name unset (defaults to ''); the bucket name read from a YAML/JSON config key that was renamed so it silently resolves to empty.","solutions":["Set a non-empty bucket name in the connector configuration","Check for typos/renames in the config key or env var that supplies the bucket name","Trim input and reject empty values in the config UI/handler before constructing the connector","Note the name is stripped at construction — a whitespace-only name will still fail, so fix the source value"],"exampleFix":"// before\nconnector = BlobStorageConnector(\n    bucket_type='s3',\n    bucket_name=os.environ.get('BUCKET_NAME', ''),  # unset -> ''\n)\n// after\nbucket = os.environ['BUCKET_NAME'].strip()  # fails fast if unset\nconnector = BlobStorageConnector(bucket_type='s3', bucket_name=bucket)","handlingStrategy":"validation","validationCode":"bucket_name = (config.get('bucket_name') or '').strip()\nif not bucket_name:\n    raise ValueError('bucket_name is required')\nconnector = BlobStorageConnector(bucket_type=bt, bucket_name=bucket_name)","typeGuard":"def is_valid_bucket_name(name: str | None) -> bool:\n    return bool(name and name.strip())","tryCatchPattern":"try:\n    connector.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    if 'No bucket name' in str(e):\n        raise ConfigError('bucket_name missing in connector config') from e\n    raise","preventionTips":["Make bucket_name a required field in the config schema so empty submissions are rejected at parse time","Beware: the constructor strips whitespace, so whitespace-only names still fail — validate the raw input"],"tags":["configuration","validation","blob-storage"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}