{"record":{"id":"004385c8a68b6372","repo":"BerriAI/litellm","slug":"knowledge-base-did-not-become-active-in-time","errorCode":null,"errorMessage":"Knowledge Base did not become active in time","messagePattern":"Knowledge Base did not become active in time","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/bedrock_ingestion.py","lineNumber":548,"sourceCode":"                        \"vectorField\": \"bedrock-knowledge-base-default-vector\",\n                    },\n                    \"vectorIndexName\": \"bedrock-kb-index\",\n                },\n            },\n        )\n        kb_id: Final = response[\"knowledgeBase\"][\"knowledgeBaseId\"]\n        self._created_resources[\"knowledge_base\"] = kb_id\n\n        # Wait for KB to be active (use asyncio.sleep to avoid blocking)\n        verbose_logger.debug(\"Waiting for Knowledge Base to be active...\")\n        for _ in range(30):\n            kb_status = bedrock_agent.get_knowledge_base(knowledgeBaseId=kb_id)\n            status = kb_status[\"knowledgeBase\"][\"status\"]\n            if status == \"ACTIVE\":\n                break\n            await asyncio.sleep(2)\n        else:\n            raise TimeoutError(\"Knowledge Base did not become active in time\")\n\n        verbose_logger.info(\"Created Knowledge Base: %s\", kb_id)\n        return kb_id\n\n    def _create_data_source(self, kb_name: str) -> str:\n        \"\"\"Create Data Source for the Knowledge Base.\"\"\"\n        bedrock_agent: Final = self._get_boto3_client(\"bedrock-agent\")\n\n        verbose_logger.debug(\"Creating Data Source for KB: %s\", self.knowledge_base_id)\n\n        response: Final = bedrock_agent.create_data_source(\n            knowledgeBaseId=self.knowledge_base_id,\n            name=f\"{kb_name}-s3-source\",\n            dataSourceConfiguration={\n                \"type\": \"S3\",\n                \"s3Configuration\": {\n                    \"bucketArn\": f\"arn:aws:s3:::{self.s3_bucket}\",\n                    \"inclusionPrefixes\": [self.s3_prefix],","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/bedrock_ingestion.py#L530-L566","documentation":"Timeout after polling get_knowledge_base for ~30 iterations: the newly created Bedrock Knowledge Base never reached ACTIVE within the wait window (slow provisioning or a failed creation, e.g. role/data-source issues). The kb_id is recorded in _created_resources but ingestion cannot proceed until it is active; check the KB status in AWS and retry.","triggerScenarios":"Thrown at litellm/rag/ingestion/bedrock_ingestion.py:548 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Knowledge Base status in AWS and retry; ensure ingestion jobs and data sources are healthy."],"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-14T05:17:10.506Z"}