Skip to content

vector_stores.files.upload_and_poll() can hang indefinitely with file status stuck at in_progress #3097

@t-kalinowski

Description

@t-kalinowski

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

vector_stores.files.upload_and_poll() can hang indefinitely.

Observed failure mode:

  • file upload succeeds
  • attaching the file to a vector store succeeds
  • upload_and_poll() never returns
  • polling vector_stores.files.retrieve() shows the file stuck at status="in_progress" forever
  • last_error stays null

The raw uploaded file is already status="processed", so the hang appears to be in vector store file processing/indexing, not raw file upload.

Environment

  • openai==2.31.0
  • Python 3.12
  • observed on April 15-16, 2026

MRE

from openai import OpenAI

client = OpenAI()

vs = client.vector_stores.create(name="probe")
result = client.vector_stores.files.upload_and_poll(
    vector_store_id=vs.id,
    file=("probe.md", b"hello world"),
)

print(result)

In the failing case above, upload_and_poll() hangs indefinitely.

Equivalent explicit polling repro:

from openai import OpenAI
import time

client = OpenAI()

vs = client.vector_stores.create(name="probe")
raw = client.files.create(file=("probe.md", b"hello world"), purpose="assistants")
client.vector_stores.files.create(vector_store_id=vs.id, file_id=raw.id)

for i in range(20):
    vf = client.vector_stores.files.retrieve(vector_store_id=vs.id, file_id=raw.id)
    rf = client.files.retrieve(raw.id)
    print(i, "vector_store_file:", vf.status, vf.last_error, "raw_file:", rf.status)
    time.sleep(2)

Observed

  • vector_store_file.status == "in_progress" indefinitely
  • vector_store_file.last_error is None
  • raw_file.status == "processed"

Expected

Either:

  • the vector store file reaches completed, or
  • it reaches failed with a real error

It should not stay in_progress forever, and upload_and_poll() should not wait forever.

To Reproduce

The following hangs indefinitely:

from openai import OpenAI

client = OpenAI()

vs = client.vector_stores.create(name="probe")
result = client.vector_stores.files.upload_and_poll(
    vector_store_id=vs.id,
    file=("probe.md", b"hello world"),
)

print(result)

Code snippets

OS

macOS

Python version

v3.12

Library version

v2.31.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions