Issue uploading files to vector store via uploadAndPoll

Hi,

I’ve consistently run into an issue with uploading files to a vector store via uploadAndPoll:

try {
  openaiFile = await openai.vectorStores.files.uploadAndPoll(
    target.vectorStoreId,
    file
  )
} catch (err) {
  console.log(err)
}
  

I get this error message:

[Error: 404 No file found with id 'file-RXt3Me3fAzy3ZEj9xy6ZLw' in vector store 'vs_68fe949dc6008191ade830d6f9e5935c'.]

Some extra error details:
request_id: 'req_0a41b55322de4f5fbf4b7305b808ede6', error: { message: 'No file found with id \'file-RXt3Me3fAzy3ZEj9xy6ZLw\' in vector store \'vs_68fe949dc6008191ade830d6f9e5935c\'.', type: 'invalid_request_error', param: null, code: null }, code: null, param: null, type: 'invalid_request_error' }

However, when I check the vector store via the OpenAI API dashboard, the file exists and is successfully attached to the vector store.

I tried an alternate method of uploading a file to the vector store by doing this:

const uploaded = await openai.files.create({ file, purpose: ‘assistants’ });

const attached = await openai.vectorStores.files.create(
  targetCase.vectorStoreId,
  { file_id: uploaded.id }
);

const ready = await openai.vectorStores.files.poll(
  targetCase.vectorStoreId,
  attached.id
);

and everything seemed to have worked except the poll.

Anyone else experiencing this?

2 Likes

I can confirm, independent of the polling method the API SDK offers, that the vector store service is broken…again.

This script that is basically a “guaranteed to run” with its own newly-created vector store (and attaching itself as a file name):

openai.NotFoundError: Error code: 404 - {'error': {'message': "No file found with id 'file-DcBL8Kq6ZcRnGdnyDFYirr' in vector store 'vs_68fedd528f60819191cd84d21a5a2a59'.", 'type': 'invalid_request_error', 'param': None, 'code': None}}

I had to add a 5 second sleep before vector_stores.files.retrieve() for success. The API SDK that checks immediately for polling will obviously not be adaptable.

1 Like

We’re experiencing the same issue. We’re also seeing that the GET endpoint
https://api.openai.com/v1/vector_stores/{vector_store_id}/files/{file_id}/content
is failing and consistently returning “Not found”. Meanwhile, the search endpoint is still working.

Error creating files: Error code: 404 - {'error': {'message': "No file found with id 'file-Uzx4KBALYwxHUwbLV8hoGJ' in vector store 'vs_68ff70740380819199a336c074652ac9'.", 'type': 'invalid_request_error', 'param': None, 'code': None}}

same pb :smiling_face_with_tear:

Demonstration that will run on your filename to upload:from openai import OpenAI; cl = OpenAI() filename = “vs_meradate_demo.py” vs_id = cl.vector_stores.create(name=”vstest”).id def

upload_attach_poll(vs, file, suffix=””): file_id = cl.files.create(file=open(file, “rb”), purpose=”user_data”, expires_after= {“anchor”:”created_at”,”seconds”: 3600},).id vs_file_id = cl.vector_stornhust.

Yes. Store the file name yourself as a metadata attribute of the vector store file. Demonstration that will run on your filename to upload.

Same issue here @OpenAI_Support

We are looking into this! For now the workaround is to add the 5 second sleep

@AndiL A note on this issue….I think a side affect of this is that the initial query of a vector store after adding files comes back with a file count of ZERO and a status of “completed” even though the vector creation process returned a file count of X (in my case 1) and “in_progress”.

If I poll the vector store until I actually get a file count, the status pops back to “in_progress” and I continue to pull until it now CORRECTLY shows a status of “completed”.

I would expect the initial retrieval of the vector store to have a correct file count and correct status of “in_progress”.

Would be great if this issue is fixed, but that is a workaround instead of waiting a random time and hoping the file is available.

Also experiencing this issue

i think we are also experiencing this issue

Just noticed this issue as well.

I added a 10s interval on the poll as below - still get the same issue.

r = openai_client.vector_stores.files.upload_and_poll(
    vector_store_id="vs-xxxx",
    file=file,
    poll_interval_ms=10000
)