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

#32221 [Bug]: Proxy returns HTTP 200 with body "null" when upstream 422s twice with drop_params=True (implicit return None in openai handler retry loop)

  • State: open
  • Author: @socks1s
  • Labels: llm translation

### What happened?

When an OpenAI-compatible upstream returns HTTP 422 twice in a row and `drop_params` is enabled, the LiteLLM proxy returns **HTTP 200 with a 4-byte body `null`** to the client instead of an error. Downstream OpenAI SDK clients then crash on `response=None`. Additionally, because no exception is raised on this path, **no SpendLogs row is written (neither success nor failure), failure callbacks do not fire, and router fallbacks are never triggered**.

Observed in production on **v1.90.0**; the same code paths are still present on current `main`.

### Root cause chain

1. An openai-compatible upstream (observed with MiniMax, `api.minimaxi.com`) returns HTTP 422 for some requests (content-moderation style rejections). The 422 body contains only a message, **no structured `detail` list of offending params**. 2. `litellm/llms/openai/openai.py` handles 422s inside `for _ in range(2):` retry loops (on current `main`: sync `completion` at L651, `acompletion` at L860, `async_streaming` at L1040; in the v1.90.0 wheel: ~L679 / ~L900 / ~L1088). With `drop_params` enabled, the `except openai.UnprocessableEntityError` branch calls `drop_params_from_unprocessable_entity_error()…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h54m11s ago — entered · #import:https:::github.com:berriai:litellm post #3176
Issue #32221 is harder because it spans multiple synchronous and asynchronous retry paths and must preserve correct exception propagation, HTTP status handling, spend logging, callbacks, and router fallback behavior. Issue #31838 is comparatively localized to adding Redis cache invalidation across customer mutation endpoints and covering it with targeted tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search