BerriAI/litellm · error · TimeoutError
OpenSearch collection did not become active in time
Error message
OpenSearch collection did not become active in time
What it means
Timeout after polling batch_get_collection for ~5 minutes: the newly created OpenSearch Serverless collection never reached ACTIVE status (stuck in CREATING/FAILED, often due to slow policy propagation or capacity limits). The collection id is recorded in _created_resources but is unusable; retry or investigate the collection in AWS.
Source
Thrown at litellm/rag/ingestion/bedrock_ingestion.py:342
# Create collection
response: Final = oss.create_collection(
name=collection_name,
type="VECTORSEARCH",
)
collection_id: Final = response["createCollectionDetail"]["id"]
self._created_resources["opensearch_collection"] = collection_name
# Wait for collection to be active (use asyncio.sleep to avoid blocking)
verbose_logger.debug("Waiting for OpenSearch collection to be active...")
for _ in range(60): # 5 min timeout
status_response = oss.batch_get_collection(ids=[collection_id])
status = status_response["collectionDetails"][0]["status"]
if status == "ACTIVE":
break
await asyncio.sleep(5)
else:
raise TimeoutError("OpenSearch collection did not become active in time")
collection_arn: Final = status_response["collectionDetails"][0]["arn"]
verbose_logger.info("Created OpenSearch collection: %s", collection_name)
# Wait for data access policy to propagate before returning
# AWS recommends waiting 60+ seconds for policy propagation
verbose_logger.debug("Waiting for data access policy to propagate (60s)...")
await asyncio.sleep(60)
return collection_name, collection_arn
async def _create_opensearch_index(self, collection_name: str):
"""Create vector index in OpenSearch collection with retry logic."""
from opensearchpy import OpenSearch, RequestsHttpConnection
from requests_aws4auth import AWS4Auth
# Get credentials for signing
credentials: Final = self.get_credentials(View on GitHub (pinned to 77b7c6c40c)
Solutions
- Retry the operation; check the OpenSearch collection status in the AWS console and increase wait time if needed.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at litellm/rag/ingestion/bedrock_ingestion.py:342 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/9b67e3c4ede785ab.
Report an issue: GitHub.