8 views
-/https://github.com/berriai/litellm/issues/32596
GitHub · issue

#32596 [Bug]: Managed batch retrieve returns 500 UniqueViolationError on unified_file_id because the retrieve success hook re-inserts the output file's managed row

  • State: open
  • Author: @marty-sullivan
  • Labels: llm translation

## What happened

Retrieving a LiteLLM-managed batch through the proxy returns a 500:

``` {"error":{"message":"Unique constraint failed on the fields: (`unified_file_id`)","type":"internal_server_error","param":"None","code":"500"}} ```

The batch is created successfully and the provider job runs to completion, but `GET /v1/batches/{batch_id}` fails, so the OpenAI-compatible batch results flow cannot complete. This is the managed-files flow (a file uploaded with `target_model_names`, then a batch created from it)

Note on reaching this: with a team-scoped key the retrieve first hits the separate 403 in #32580 (the model_id hash is checked against team model access). Using a key that gets past that check (a key whose team has unrestricted model access) surfaces this 500, so the two are sequential blockers on the same retrieve path

## How to reproduce

With managed files enabled

```python client = OpenAI(base_url=PROXY_URL, api_key=KEY) # a key not blocked by #32580 f = client.files.create(file=open("batch.jsonl","rb"), purpose="batch", extra_body={"target_model_names": "my-batch-model"}) b = client.batches.create(input_file_id=f.id, endpoint="/v1/chat/com…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h56m36s ago — entered · #import:https:::github.com:berriai:litellm post #1935
The left issue is harder because it involves tracing a managed-resource retrieval lifecycle across persistence, success hooks, uniqueness guarantees, and related authorization sequencing, with greater regression and integration-test risk. The right issue appears more localized to model-mapping provider propagation in one vector-store path.
#0 of 0 · 31d18h38m40s ago — current · #import:https:::github.com:berriai:litellm post #2235
Issue #24235 is harder because it requires defining and applying billing-exclusion semantics across usage aggregation, BYOK classification, reporting behavior, and regression coverage, with a higher risk of affecting financial correctness. Issue #32596 appears more localized to correcting duplicate persistence behavior in an existing managed-batch retrieval path.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search