{"record":{"id":"5f2d60889141089f","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-vector-store-id-b-5f2d60","errorCode":null,"errorMessage":"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}","messagePattern":"Expected a non-empty value for `vector_store_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/vector_stores/vector_stores.py","lineNumber":175,"sourceCode":"        extra_headers: Headers | None = None,\n        extra_query: Query | None = None,\n        extra_body: Body | None = None,\n        timeout: float | httpx2.Timeout | None | NotGiven = not_given,\n    ) -> VectorStore:\n        \"\"\"\n        Retrieves a vector store.\n\n        Args:\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not vector_store_id:\n            raise ValueError(f\"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}\")\n        extra_headers = {\"OpenAI-Beta\": \"assistants=v2\", **(extra_headers or {})}\n        return self._get(\n            path_template(\"/vector_stores/{vector_store_id}\", vector_store_id=vector_store_id),\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                security={\"bearer_auth\": True},\n            ),\n            cast_to=VectorStore,\n        )\n\n    def update(\n        self,\n        vector_store_id: str,\n        *,\n        expires_after: Optional[vector_store_update_params.ExpiresAfter] | Omit = omit,","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/vector_stores/vector_stores.py#L157-L193","documentation":"The synchronous `retrieve` on vector stores validates that `vector_store_id` is a non-empty string before GETting `/vector_stores/{vector_store_id}`. An empty or None id raises this ValueError immediately, before any HTTP traffic.","triggerScenarios":"Calling client.vector_stores.retrieve(vector_store_id=\"\" or None); usually a stale id variable, an unset env/config value, or a wrong attribute on an Assistant/Thread object.","commonSituations":"Using assistant.tool_resources instead of the actual store id, ids from deleted stores still referenced in app state, or config keys differing between environments.","solutions":["Confirm you are passing a literal store id string (starts with 'vs-').","Print the variable's value and origin right before the call.","If it comes from an assistant, read it from the correct nested field of tool_resources.file_search."],"exampleFix":"# before\nvs = client.vector_stores.retrieve(vector_store_id=store_id)  # store_id is None\n\n# after\nstore_id = assistant.tool_resources.file_search.vector_store_ids[0] if assistant.tool_resources else None\nif not store_id:\n    raise ValueError(\"no vector store attached to assistant\")\nvs = client.vector_stores.retrieve(vector_store_id=store_id)","handlingStrategy":"validation","validationCode":"if not vector_store_id:\n    raise ValueError(\"vector_store_id required to retrieve a store\")","typeGuard":"def is_store_id(value: object) -> bool:\n    return isinstance(value, str) and value.startswith(\"vs-\")","tryCatchPattern":null,"preventionTips":["Read store ids from the correct nested tool_resources fields.","Verify store ids exist before reusing them across sessions."],"tags":["vector-stores","sync","required-parameter","validation","sdk"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}