{"record":{"id":"efc465c16871811d","repo":"BerriAI/litellm","slug":"no-data-sources-found-for-knowledge-base-self-kno","errorCode":null,"errorMessage":"No data sources found for Knowledge Base {self.knowledge_base_id}. Please create a data source first or provide data_source_id and s3_bucket.","messagePattern":"No data sources found for Knowledge Base (.+?)\\. Please create a data source first or provide data_source_id and s3_bucket\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/bedrock_ingestion.py","lineNumber":150,"sourceCode":"            self._auto_detect_config()\n        else:\n            # No KB provided - create everything from scratch\n            await self._create_knowledge_base_infrastructure()\n\n        self._config_initialized = True\n\n    def _auto_detect_config(self):\n        \"\"\"Auto-detect data source ID and S3 bucket from existing Knowledge Base.\"\"\"\n        verbose_logger.debug(\"Auto-detecting data source and S3 bucket for KB=%s\", self.knowledge_base_id)\n\n        bedrock_agent: Final = self._get_boto3_client(\"bedrock-agent\")\n\n        # List data sources for this KB\n        ds_response: Final = bedrock_agent.list_data_sources(knowledgeBaseId=self.knowledge_base_id)\n        data_sources: Final = ds_response.get(\"dataSourceSummaries\", [])\n\n        if not data_sources:\n            raise ValueError(\n                f\"No data sources found for Knowledge Base {self.knowledge_base_id}. \"\n                \"Please create a data source first or provide data_source_id and s3_bucket.\"\n            )\n\n        # Use first data source (or user-provided override)\n        if self._data_source_id:\n            self.data_source_id = self._data_source_id\n        else:\n            self.data_source_id = data_sources[0][\"dataSourceId\"]\n            verbose_logger.info(\"Auto-detected data source: %s\", self.data_source_id)\n\n        # Get data source details for S3 bucket\n        ds_details: Final = bedrock_agent.get_data_source(\n            knowledgeBaseId=self.knowledge_base_id,\n            dataSourceId=self.data_source_id,\n        )\n\n        s3_config = ds_details.get(\"dataSource\", {}).get(\"dataSourceConfiguration\", {}).get(\"s3Configuration\", {})","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/bedrock_ingestion.py#L132-L168","documentation":"Auto-detection dead end in the Bedrock ingestion flow: an existing knowledge_base_id was supplied, but listing its data sources via bedrock-agent returned none (and no data_source_id/s3_bucket were provided), so there is no target to ingest into. Create a data source on the KB in AWS or pass data_source_id and s3_bucket explicitly.","triggerScenarios":"Thrown at litellm/rag/ingestion/bedrock_ingestion.py:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create a data source for the Knowledge Base first, or pass data_source_id and s3_bucket in the 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"}