{"record":{"id":"9b67e3c4ede785ab","repo":"BerriAI/litellm","slug":"opensearch-collection-did-not-become-active-in-tim","errorCode":null,"errorMessage":"OpenSearch collection did not become active in time","messagePattern":"OpenSearch collection did not become active in time","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/bedrock_ingestion.py","lineNumber":342,"sourceCode":"\n        # Create collection\n        response: Final = oss.create_collection(\n            name=collection_name,\n            type=\"VECTORSEARCH\",\n        )\n        collection_id: Final = response[\"createCollectionDetail\"][\"id\"]\n        self._created_resources[\"opensearch_collection\"] = collection_name\n\n        # Wait for collection to be active (use asyncio.sleep to avoid blocking)\n        verbose_logger.debug(\"Waiting for OpenSearch collection to be active...\")\n        for _ in range(60):  # 5 min timeout\n            status_response = oss.batch_get_collection(ids=[collection_id])\n            status = status_response[\"collectionDetails\"][0][\"status\"]\n            if status == \"ACTIVE\":\n                break\n            await asyncio.sleep(5)\n        else:\n            raise TimeoutError(\"OpenSearch collection did not become active in time\")\n\n        collection_arn: Final = status_response[\"collectionDetails\"][0][\"arn\"]\n        verbose_logger.info(\"Created OpenSearch collection: %s\", collection_name)\n\n        # Wait for data access policy to propagate before returning\n        # AWS recommends waiting 60+ seconds for policy propagation\n        verbose_logger.debug(\"Waiting for data access policy to propagate (60s)...\")\n        await asyncio.sleep(60)\n\n        return collection_name, collection_arn\n\n    async def _create_opensearch_index(self, collection_name: str):\n        \"\"\"Create vector index in OpenSearch collection with retry logic.\"\"\"\n        from opensearchpy import OpenSearch, RequestsHttpConnection\n        from requests_aws4auth import AWS4Auth\n\n        # Get credentials for signing\n        credentials: Final = self.get_credentials(","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/bedrock_ingestion.py#L324-L360","documentation":"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.","triggerScenarios":"Thrown at litellm/rag/ingestion/bedrock_ingestion.py:342 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the operation; check the OpenSearch collection status in the AWS console and increase wait time if needed."],"exampleFix":null,"handlingStrategy":"retry","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-14T00:17:10.932Z"}