BerriAI/litellm · error · ProxyException
End User Id={end_user_id} does not exist in db
Error message
End User Id={end_user_id} does not exist in db What it means
GET /customer/info looks end_user_id up in LiteLLM_EndUserTable via find_first; when no row matches it raises a 404 not_found ProxyException echoing the requested id (param=end_user_id). This is a clean not-found signal, not a server fault.
Source
Thrown at litellm/proxy/management_endpoints/customer_endpoints.py:534
-H 'Authorization: Bearer sk-1234'
```
"""
try:
from litellm.proxy.proxy_server import prisma_client
if prisma_client is None:
raise HTTPException(
status_code=500,
detail={"error": CommonProxyErrors.db_not_connected_error.value},
)
user_info: Final = await _typed_table(EndUserRepository(prisma_client)).find_first(
where={"user_id": end_user_id},
include={"litellm_budget_table": True, "object_permission": True},
)
if user_info is None:
raise ProxyException(
message=f"End User Id={end_user_id} does not exist in db",
type="not_found",
code=404,
param="end_user_id",
)
return _to_customer_response(user_info)
except Exception as e:
verbose_proxy_logger.exception(
"litellm.proxy.management_endpoints.customer_endpoints.end_user_info(): Exception occured - %s", e
)
raise handle_exception_on_proxy(e)
@router.post(
"/customer/update",
tags=["Customer Management"],View on GitHub (pinned to 77b7c6c40c)
Solutions
- List customers with GET /customer/list (admin) and copy the exact user_id
- Create the customer first via POST /customer/new if it should exist
- Normalize ids (strip whitespace, stable casing) on both create and lookup
Defensive patterns
Strategy: try-catch
Try / catch
import httpx
def get_customer_or_none(base: str, headers: dict, end_user_id: str) -> dict | None:
r = httpx.get(f"{base}/customer/info", params={"end_user_id": end_user_id}, headers=headers)
if r.status_code == 404:
return None
r.raise_for_status()
return r.json() Prevention
- Handle 404 from /customer/info as a normal 'missing' branch, not an error to alert on
- Sync external ids into LiteLLM at creation time rather than assuming they exist
- Trim and canonicalize ids before querying to avoid phantom not-founds
When it happens
Trigger: GET /customer/info?end_user_id=X where X was never created, was deleted via /customer/delete, or differs by casing/whitespace from the stored user_id.
Common situations: Lookups by ids from an external CRM that were never synced into LiteLLM; queries after cleanup jobs deleted end users; copy-paste or URL-encoding mistakes in ids.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- End User Id={data.user_id} does not exist in db
- End User Id(s)={} do not exist in db
- 404
- Failed updating customer data. User ID does not exist passed
- LiteLLM Managed File object with id={file_id} not found
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/9509234e06763926.
Report an issue: GitHub.