{"record":{"id":"9d88c876d935ed46","repo":"BerriAI/litellm","slug":"vertex-project-is-required-for-vertex-ai-rag-inges","errorCode":null,"errorMessage":"vertex_project is required for Vertex AI RAG ingestion. Set via vector_store config or VERTEXAI_PROJECT env var.","messagePattern":"vertex_project is required for Vertex AI RAG ingestion\\. Set via vector_store config or VERTEXAI_PROJECT env var\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/rag_engine/ingestion.py","lineNumber":102,"sourceCode":"            self.vector_store_config.get(\"vertex_location\") or get_secret_str(\"VERTEXAI_LOCATION\") or \"us-central1\"\n        )\n        self.vertex_credentials = self.vector_store_config.get(\"vertex_credentials\")\n\n        # GCS bucket for file uploads\n        self.gcs_bucket = self.vector_store_config.get(\"gcs_bucket\") or os.environ.get(\"GCS_BUCKET_NAME\")\n        if not self.gcs_bucket:\n            raise ValueError(\n                \"gcs_bucket is required for Vertex AI RAG ingestion. \"\n                \"Set via vector_store config or GCS_BUCKET_NAME env var.\"\n            )\n\n        # Import settings\n        self.wait_for_import = self.vector_store_config.get(\"wait_for_import\", True)\n        self.import_timeout = _get_int(self.vector_store_config.get(\"import_timeout\"), 600)\n\n        # Validate required config\n        if not self.vertex_project:\n            raise ValueError(\n                \"vertex_project is required for Vertex AI RAG ingestion. \"\n                \"Set via vector_store config or VERTEXAI_PROJECT env var.\"\n            )\n\n    def _get_corpus_name(self) -> str:\n        \"\"\"Get full corpus resource name.\"\"\"\n        return f\"projects/{self.vertex_project}/locations/{self.vertex_location}/ragCorpora/{self.corpus_id}\"\n\n    async def _upload_file_to_gcs(\n        self,\n        file_content: bytes,\n        filename: str,\n        content_type: str,\n    ) -> str:\n        \"\"\"\n        Upload file to GCS using litellm.files.acreate_file.\n\n        Returns:","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/rag_engine/ingestion.py#L84-L120","documentation":"ValueError raised in VertexRAGIngestion.__init__ when vertex_project cannot be resolved from the vector_store config or the VERTEXAI_PROJECT environment variable. The project is required to build corpus resource names like projects/{project}/locations/{location}/ragCorpora/{id}, so init fails fast before any GCP call is made.","triggerScenarios":"RAG ingestion config lacking vertex_project while VERTEXAI_PROJECT is unset in the process environment.","commonSituations":"Credentials JSON present but the project not configured anywhere; env vars not carried into containers or serverless runtimes; multi-project confusion.","solutions":["Set vertex_project='my-project' in the vector_store config, or export VERTEXAI_PROJECT=my-project","Verify with echo $VERTEXAI_PROJECT","Prefer explicit config over env in multi-project setups to avoid importing into the wrong project"],"exampleFix":"# before\nvector_store_config = {'vector_store_id': 'corpus-123', 'gcs_bucket': 'my-bucket'}\n\n# after\nvector_store_config = {\n    'vector_store_id': 'corpus-123',\n    'gcs_bucket': 'my-bucket',\n    'vertex_project': 'my-project',  # or: export VERTEXAI_PROJECT=my-project\n}","handlingStrategy":"validation","validationCode":"import os\n\ncfg = get_vector_store_config()\nproject = cfg.get('vertex_project') or os.environ.get('VERTEXAI_PROJECT')\nassert project, 'vertex_project or VERTEXAI_PROJECT is required for vertex_ai RAG ingestion'","typeGuard":null,"tryCatchPattern":"try:\n    ingestion = VertexRAGIngestion(ingest_options=opts, router=router)\nexcept ValueError as e:\n    if 'vertex_project' in str(e):\n        raise SystemExit('Set vertex_project in config or export VERTEXAI_PROJECT')\n    raise","preventionTips":["Set VERTEXAI_PROJECT in every runtime that touches Vertex AI","Prefer explicit vertex_project config in multi-project setups","Add a startup assertion covering corpus ID, bucket, and project together"],"tags":["vertex-ai","rag","configuration","gcp-project"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}