{"record":{"id":"eb953bda50cf5e82","repo":"BerriAI/litellm","slug":"could-not-auto-detect-s3-bucket-for-data-source-s","errorCode":null,"errorMessage":"Could not auto-detect S3 bucket for data source {self.data_source_id}. Please provide s3_bucket in config.","messagePattern":"Could not auto-detect S3 bucket for data source (.+?)\\. Please provide s3_bucket in config\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/bedrock_ingestion.py","lineNumber":182,"sourceCode":"            knowledgeBaseId=self.knowledge_base_id,\n            dataSourceId=self.data_source_id,\n        )\n\n        s3_config = ds_details.get(\"dataSource\", {}).get(\"dataSourceConfiguration\", {}).get(\"s3Configuration\", {})\n\n        bucket_arn: Final = s3_config.get(\"bucketArn\", \"\")\n        if bucket_arn:\n            # Extract bucket name from ARN: arn:aws:s3:::bucket-name\n            self.s3_bucket = self._s3_bucket or bucket_arn.split(\":\")[-1]\n            verbose_logger.info(\"Auto-detected S3 bucket: %s\", self.s3_bucket)\n\n            # Use inclusion prefix if available\n            prefixes: Final = s3_config.get(\"inclusionPrefixes\", [])\n            if prefixes and not self._s3_prefix:\n                self.s3_prefix = prefixes[0]\n        else:\n            if not self._s3_bucket:\n                raise ValueError(\n                    f\"Could not auto-detect S3 bucket for data source {self.data_source_id}. \"\n                    \"Please provide s3_bucket in config.\"\n                )\n            self.s3_bucket = self._s3_bucket\n\n    async def _create_knowledge_base_infrastructure(self):\n        \"\"\"Create all AWS resources needed for a new Knowledge Base.\"\"\"\n        verbose_logger.info(\"Creating new Bedrock Knowledge Base infrastructure...\")\n\n        # Generate unique names\n        unique_id: Final = uuid.uuid4().hex[:8]\n        kb_name: Final = self.ingest_name or f\"litellm-kb-{unique_id}\"\n\n        # Get AWS account ID and caller ARN (for data access policy)\n        sts: Final = self._get_boto3_client(\"sts\")\n        caller_identity: Final = sts.get_caller_identity()\n        account_id: Final = caller_identity[\"Account\"]\n        caller_arn: Final = caller_identity[\"Arn\"]","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/bedrock_ingestion.py#L164-L200","documentation":"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.","triggerScenarios":"Thrown at litellm/rag/ingestion/bedrock_ingestion.py:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide s3_bucket explicitly in the vector store config."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}