{"record":{"id":"90d8f5e4cd822d79","repo":"BerriAI/litellm","slug":"failed-to-create-rag-corpus-response-text","errorCode":null,"errorMessage":"Failed to create RAG corpus: {response.text}","messagePattern":"Failed to create RAG corpus: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/vertex_ai_ingestion.py","lineNumber":191,"sourceCode":"        verbose_logger.debug(\"Request body: %s\", json.dumps(request_body, indent=2))\n\n        client: Final = get_async_httpx_client(\n            llm_provider=httpxSpecialProvider.RAG,\n            params={\"timeout\": 60.0},\n        )\n\n        response: Final = await client.post(\n            url,\n            json=request_body,\n            headers={\n                \"Authorization\": f\"Bearer {access_token}\",\n                \"Content-Type\": \"application/json\",\n            },\n        )\n        if response.status_code not in [200, 201]:\n            error_msg: Final = f\"Failed to create RAG corpus: {response.text}\"\n            verbose_logger.error(error_msg)\n            raise Exception(error_msg)\n\n        response_data: Final = response.json()\n        verbose_logger.debug(\"Create corpus response: %s\", json.dumps(response_data, indent=2))\n\n        # The response is a long-running operation\n        # Check if it's already done or if we need to poll\n        if response_data.get(\"done\"):\n            # Operation completed immediately\n            corpus_name = response_data.get(\"response\", {}).get(\"name\", \"\")\n        else:\n            # Need to poll the operation\n            operation_name: Final = response_data.get(\"name\", \"\")\n            verbose_logger.debug(\"Polling operation: %s\", operation_name)\n            corpus_name = await self._poll_operation(\n                operation_name=operation_name,\n                access_token=access_token,\n            )\n","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/vertex_ai_ingestion.py#L173-L209","documentation":"Raised when the Vertex AI RAG createCorpus HTTP call returns a status other than 200/201; the raw Vertex AI error body is embedded, indicating a project/permission/API-enablement problem on the provider side rather than a local validation failure.","triggerScenarios":"Thrown at litellm/rag/ingestion/vertex_ai_ingestion.py:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the response text for the API error; verify Vertex credentials, project, and region."],"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"}