BerriAI/litellm · error · ValueError

Could not auto-detect S3 bucket for data source {self.data_s

Error message

Could not auto-detect S3 bucket for data source {self.data_source_id}. Please provide s3_bucket in config.

What it means

Auto-detection gap: the KB's data source was found, but its dataSourceConfiguration has no s3Configuration.bucketArn (or it's empty), so the S3 bucket for uploads could not be inferred. Provide s3_bucket in the vector-store config explicitly to proceed.

Source

Thrown at litellm/rag/ingestion/bedrock_ingestion.py:182

            knowledgeBaseId=self.knowledge_base_id,
            dataSourceId=self.data_source_id,
        )

        s3_config = ds_details.get("dataSource", {}).get("dataSourceConfiguration", {}).get("s3Configuration", {})

        bucket_arn: Final = s3_config.get("bucketArn", "")
        if bucket_arn:
            # Extract bucket name from ARN: arn:aws:s3:::bucket-name
            self.s3_bucket = self._s3_bucket or bucket_arn.split(":")[-1]
            verbose_logger.info("Auto-detected S3 bucket: %s", self.s3_bucket)

            # Use inclusion prefix if available
            prefixes: Final = s3_config.get("inclusionPrefixes", [])
            if prefixes and not self._s3_prefix:
                self.s3_prefix = prefixes[0]
        else:
            if not self._s3_bucket:
                raise ValueError(
                    f"Could not auto-detect S3 bucket for data source {self.data_source_id}. "
                    "Please provide s3_bucket in config."
                )
            self.s3_bucket = self._s3_bucket

    async def _create_knowledge_base_infrastructure(self):
        """Create all AWS resources needed for a new Knowledge Base."""
        verbose_logger.info("Creating new Bedrock Knowledge Base infrastructure...")

        # Generate unique names
        unique_id: Final = uuid.uuid4().hex[:8]
        kb_name: Final = self.ingest_name or f"litellm-kb-{unique_id}"

        # Get AWS account ID and caller ARN (for data access policy)
        sts: Final = self._get_boto3_client("sts")
        caller_identity: Final = sts.get_caller_identity()
        account_id: Final = caller_identity["Account"]
        caller_arn: Final = caller_identity["Arn"]

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide s3_bucket explicitly in the vector store config.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/rag/ingestion/bedrock_ingestion.py:182 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/eb953bda50cf5e82. Report an issue: GitHub.