6 views
-/https://github.com/berriai/litellm/issues/33987
GitHub · issue

#33987 [Bug]: Completed all-error batch crashes logging when output_file_id is null

  • State: open
  • Author: @jimmychen-p72
  • Labels: llm translation

## What happened

A batch where every request line fails can legitimately return:

```json { "status": "completed", "output_file_id": null, "error_file_id": "file-..." } ```

LiteLLM's batch success logging then repeatedly crashes with:

```text ValueError: Output file id is None cannot retrieve file content ```

The error occurs inside the logging worker on every `aretrieve_batch` poll, producing repeated error logs and skipping the completed batch's zero-cost accounting.

## Reproduction

1. Configure a managed batch model and proxy logging. 2. Upload a valid JSONL batch input where every request line is provider-invalid. 3. Create the batch and wait for terminal state. 4. Retrieve the batch repeatedly.

For OpenAI and Azure, successful lines are written to `output_file_id` and failed lines are written to a separate `error_file_id`. An all-error batch therefore has no output file.

## Root cause

`litellm/batches/batch_utils.py::_handle_completed_batch` unconditionally invokes `_get_batch_output_file_content_as_dictionary(...)`, which raises when `batch.output_file_id is None`. The call comes from `async_success_handler` / LoggingWorker for `aretrieve_batch`, so the same ex…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h8m35s ago — entered · #import:https:::github.com:berriai:litellm post #2701
Issue 33987 is harder because it spans asynchronous batch polling, terminal-state handling, logging-worker error propagation, provider-specific file semantics, and zero-cost accounting, requiring broader regression coverage. Issue 28239 is comparatively localized to request-parameter normalization for embedding calls and vLLM compatibility.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search