BerriAI/litellm · error · ValueError
No data sources found for Knowledge Base {self.knowledge_bas
Error message
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. What it means
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.
Source
Thrown at litellm/rag/ingestion/bedrock_ingestion.py:150
self._auto_detect_config()
else:
# No KB provided - create everything from scratch
await self._create_knowledge_base_infrastructure()
self._config_initialized = True
def _auto_detect_config(self):
"""Auto-detect data source ID and S3 bucket from existing Knowledge Base."""
verbose_logger.debug("Auto-detecting data source and S3 bucket for KB=%s", self.knowledge_base_id)
bedrock_agent: Final = self._get_boto3_client("bedrock-agent")
# List data sources for this KB
ds_response: Final = bedrock_agent.list_data_sources(knowledgeBaseId=self.knowledge_base_id)
data_sources: Final = ds_response.get("dataSourceSummaries", [])
if not data_sources:
raise ValueError(
f"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."
)
# Use first data source (or user-provided override)
if self._data_source_id:
self.data_source_id = self._data_source_id
else:
self.data_source_id = data_sources[0]["dataSourceId"]
verbose_logger.info("Auto-detected data source: %s", self.data_source_id)
# Get data source details for S3 bucket
ds_details: Final = bedrock_agent.get_data_source(
knowledgeBaseId=self.knowledge_base_id,
dataSourceId=self.data_source_id,
)
s3_config = ds_details.get("dataSource", {}).get("dataSourceConfiguration", {}).get("s3Configuration", {})View on GitHub (pinned to 77b7c6c40c)
Solutions
- Create a data source for the Knowledge Base first, or pass data_source_id and s3_bucket in the config.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/rag/ingestion/bedrock_ingestion.py:150 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/efc465c16871811d.
Report an issue: GitHub.