Skip to content

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

Closed

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

Activity

  1. nightcityblade commented on May 2, 2026

    @nightcityblade
    Contributor

    Hi, I'd like to work on this. I'll submit a PR shortly.

  2. added a commit that references this issue on Jun 1, 2026
    61f7176
  3. marcuswood-oai commented on Sep 10, 2026

    @marcuswood-oai
    Contributor

    Thanks for reporting this! #3401 is merged and adds an optional max_wait_seconds to limit vector-store file polling. This bounds polling in the SDK; stalled indexing still needs service-side investigation.

  4. added a commit that references this issue on Sep 10, 2026
    ae41bc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions