{"record":{"id":"b0b5e011138bbeee","repo":"BerriAI/litellm","slug":"vector-store-id-is-required-when-ingesting-an-exis","errorCode":null,"errorMessage":"vector_store_id is required when ingesting an existing file_id","messagePattern":"vector_store_id is required when ingesting an existing file_id","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/openai_ingestion.py","lineNumber":90,"sourceCode":"            file_content: Raw file bytes\n            filename: Name of the file\n            content_type: MIME type\n            chunks: Ignored - OpenAI handles chunking\n            embeddings: Ignored - OpenAI handles embedding\n            existing_file_id: Existing OpenAI file ID to attach\n\n        Returns:\n            Tuple of (vector_store_id, file_id)\n        \"\"\"\n        vector_store_id = self.vector_store_config.get(\"vector_store_id\")\n        ttl_days: Final = self.vector_store_config.get(\"ttl_days\")\n\n        # Get credentials from vector_store_config (loaded from litellm_credential_name if provided)\n        api_key: Final = self.vector_store_config.get(\"api_key\")\n        api_base: Final = self.vector_store_config.get(\"api_base\")\n\n        if existing_file_id and not vector_store_id:\n            raise ValueError(\"vector_store_id is required when ingesting an existing file_id\")\n\n        # Create vector store if not provided\n        if not vector_store_id:\n            expires_after: Final = {\"anchor\": \"last_active_at\", \"days\": ttl_days} if ttl_days else None\n            create_response: Final = await vector_store_acreate(\n                name=self.ingest_name or \"litellm-rag-ingest\",\n                custom_llm_provider=\"openai\",\n                expires_after=expires_after,\n                api_key=api_key,\n                api_base=api_base,\n            )\n            vector_store_id = create_response.get(\"id\")\n\n        if existing_file_id and vector_store_id:\n            await vector_store_file_acreate(\n                vector_store_id=vector_store_id,\n                file_id=existing_file_id,\n                custom_llm_provider=\"openai\",","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/openai_ingestion.py#L72-L108","documentation":"Input guard in the OpenAI ingestion flow: an existing OpenAI file_id was supplied to attach to a vector store, but no vector_store_id was configured, so there is nowhere to attach the file. Provide vector_store_id in the vector store config, or upload fresh file data instead.","triggerScenarios":"Thrown at litellm/rag/ingestion/openai_ingestion.py:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide vector_store_id when ingesting an existing OpenAI file_id."],"exampleFix":null,"handlingStrategy":"validation","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"}