What does the files status "error" mean

I’ve uploaded a couple documents to the /files endpoint with:

openai.File.create(file=open(“upload-files.JSONL”, encoding=‘utf-8’), purpose=“search”)

I get no error here but when looking at the files with:

curl https://api.openai.com/v1/files
-H ‘Authorization: Bearer YOUR_API_KEY’

I get the following response:
“id”: “file-xxxxxxxxxxxxxxxxxxxxxxxxxx”,
“object”: “file”,
“bytes”: 36611,
“created_at”: 1618160623,
“filename”: “upload-files.JSONL”,
“purpose”: “search”,
"status": "error"

Does anybody what kind of error this may be or how I could get more information on it?

btw:
I tried searching through the documents with the exact text from one of the documents. This failed with the error “No similar documents were found in file with ID ‘file-xxxxxxxxxxxxxxx’.Please upload more documents or adjust your query.”

Hey Kris, with an error like this, it may that the document isn’t in the proper JSONL format. Would it be possible to share a snippet of your JSONL file (text anonymised if needed)?

Since there was an error in creating the file, you wouldn’t be able to search through the documents.

Yes, the first line looks like this. I replaced the text for readability. The longest text in whole file has 350 tokens.

{“text”: “…text…” , “metadata”: “00010 Name”}

When writing this I did notice the extra space (the italic one :wink: ) after the comma. I reuploaded the file without but got the same (?) error.

RESOLVED:
Thanks to @joey to for pointing me in the right direction. The script that creates the upload file just needed to pass the data as a dict to the jsonlines writer (not as a string).

Great service, would error again :+1:

5 Likes