Repository navigation
fix(proxy)!: stop labelling management and health rejections as auth failures - #48739
Conversation
…nstead of auth_error
…es with 503 in route catch-alls /key/list and /key/aliases now share the catch-all helper too, so they stop adding the Authentication Error prefix and typing a 400 as internal_server_error
…ror_types_main # Conflicts: # tests/unit/proxy/health_endpoints/test_health_endpoints.py # tests/unit/proxy/management_endpoints/test_key_management_endpoints.py # tests/unit/proxy/management_endpoints/test_organization_endpoints.py # tests/unit/proxy/test_proxy_server.py
Merging this PR will not alter performance1 warning
Comparing |
…ails to name the error A real outage surfaces from prisma's query engine as a builtin AttributeError, which the prisma-module check skipped, so the route catch-alls still answered 500 or 400
|
@litereview code-review |
[High impact] The PR appears safe to merge with the intended error-response changes SummaryThe PR replaces repeated error wrappers with No new actionable issues were found. The previous code findings are addressed by the Prisma guard, exception-chain checks, real-router test, and typed test additions
Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…bel upstream failures by their own status
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
…ror on tag denials, report model insert outages as 503
… errors like chat A database that refuses connections while starting up, shutting down, in recovery, or read-only after a failover now answers 503 no_db_connection instead of 400. A provider's 401 or 403 keeps the type /chat/completions gives it, while a 401 or 403 the proxy raises keeps auth_error. An exception with no message is named by its type.
… re-raised error's cause
…sals Team-not-found 404s now answer invalid_request_error, and every handler-raised refusal answers param null instead of the string None.
|
bugbot run |
…ror_types_main # Conflicts: # tests/unit/proxy/test_proxy_server.py
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9f25ff8. Configure here.
Management and health routes like
/team/info,/user/updateand/key/updatelabel every rejectiontype: auth_error, even a 404 for a missing team or a 400 for a badbudget_duration, so a script branching ontypere-mints a key that was never the problemNow their 13 catch-all handlers name the error by its status, so a 400 or 404 says
invalid_request_error, a 500 saysinternal_server_error, and a 401 or 403 the proxy raises keepsauth_error. Database outages and failovers answer 503, and the made-upAuthentication Error,prefix is goneIt replaces #47778 and the older #39558
Original
Breaking change: clients that branch on these routes' error
typeorparam, or on their status during outages, should check retry and alert rulesTLDR
Problem this solves:
type: auth_errorbudget_durationsays soHow it solves it:
auth_errorProxyException, real auth and SSO keep their typesIntentional product change: these routes' 400, 404 and 500 errors stop saying
auth_error, andparamis null instead of"None". Database outages and failovers, failed config reads, queued upstream failures, and errors that carry their own status, like an upstream timeout's 408, answer new statuses. Keeping every status, as the replaced PRs did, would leave outages at 400 or 500, which retry logic reads as the caller's faultUser Flow
Before: an admin scripting the management API is told their credentials failed when the request body was the problem
{"user_id":"u1","budget_duration":"not-a-duration"}and a valid admin key400with"type":"auth_error"and a message startingAuthentication Error,404with"type":"auth_error"tooAfter: the same requests are labelled for what went wrong
400with"type":"invalid_request_error"and the validation message, still wrapped in{'error': ...}as on main404with"type":"invalid_request_error"401with its own auth typePre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
GET /team/info, missing teamauth_errorinvalid_request_errorPOST /user/update, badbudget_durationauth_errorinvalid_request_errorPOST /key/update, badbudget_durationauth_errorinvalid_request_errorPOST /organization/member_add, missing orgauth_errorinvalid_request_errorPOST /model/delete, missing idauth_errorinvalid_request_errorPOST /model/update, missing idauth_errorinvalid_request_errorPOST /model/new, duplicate idauth_errorinternal_server_errorGET /health/services, unknown serviceauth_errorinvalid_request_errorPOST /config/update, non-string callbackauth_errorinvalid_request_errorGET /key/list, badstatusinternal_server_errorinvalid_request_errorPOST /queue/chat/completions, upstream answers 503auth_errorinternal_server_errorGET /get/config/callbacks, config file emptiedauth_errorinternal_server_errorPOST /queue/chat/completions, Anthropic answers 404auth_errorinvalid_request_errorPOST /queue/chat/completions, Anthropic rejects the keyauth_errorauthentication_error10 database outage cases, each 503 `no_db_connection` after
GET /key/list, database offlineinternal_server_errorno_db_connectionGET /key/aliases, database offlineinternal_server_errorno_db_connectionPOST /key/update, database offlineauth_errorno_db_connectionGET /key/list, database host unreachableinternal_server_errorno_db_connectionGET /key/aliases, database host unreachableinternal_server_errorno_db_connectionPOST /key/update, database host unreachableauth_errorno_db_connectionPOST /key/update, team table lockedauth_errorno_db_connectionPOST /model/new, database host unreachableauth_errorno_db_connectionPOST /key/update, database failed over to read-onlyauth_errorno_db_connectionPOST /key/update, reconnected read-only sessionauth_errorno_db_connection8 controls that answer the same on both legs
POST /queue/chat/completions, no priorityinvalid_request_errorinvalid_request_errorPOST /queue/chat/completions, unknown modelinvalid_request_errorinvalid_request_errorGET /get/config/callbacks, scalar callback storedGET /team/info, caller outside teamauth_errorauth_errortoken_not_found_in_dbtoken_not_found_in_dbauth_errorauth_errorPOST /queue/chat/completions, Anthropic answersShared setup
Two live proxies on the GCE QA box, same config, same cases, same order, differing only in the commit they booted from. Each ran two uvicorn workers against its own Postgres database, with real Anthropic credentials, and every call uses a valid admin key unless the case says otherwise.
RUN=$(date +%s)keeps the ids cases 8 and 15 create unique per runCases 18 to 20 take that proxy's database offline on the shared Postgres server and bring it back afterwards
Cases 24 to 26 run on the same two proxies after the database is back. Case 24 points a new model at a local server that answers 503, case 25 empties the shared config file for one call, and case 26 holds a table lock long enough for the proxy's 10 second lookup deadline to pass
Cases 31 and 32 run after them on the same two proxies and reset
default_transaction_read_onlyafterwardsCases 27, 28 and 30 run there last, with real Anthropic calls. Case 27 points a new model at a model name Anthropic answers 404 for, and case 30 adds a deployment whose Anthropic key Anthropic rejects
Cases 21 to 23 and 29 boot one more proxy per leg, same config and two workers, whose
DATABASE_URLpoints at a local TCP forwarder in front of the same Postgres server.GET /key/listanswers 200 through it, then the forwarder is stopped so the database host refuses every new connection, the way a dropped database node or network partition looks to the proxyBefore (83ae1bd)
2.
GET /team/info, missing team{"error":{"message":"{'message': 'Team not found, passed team id: no-such-team-qa.'}","type":"auth_error","param":"None","code":"404"}}The other 31 cases
1. Sanity, real Anthropic call
{"id":"chatcmpl-a1e54223-b13a-496e-9417-04b125d78fcb","created":1793247468,"model":"claude-haiku-5-5","object":"chat.completion","choices":[{"finish_reason":"stop","index":0,"message":{"content":"slp-qa-ok","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":22,"total_tokens":32,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":22,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"inference_geo":"global","speed":"standard","service_tier":"standard"}}3.
POST /user/update, badbudget_duration{"error":{"message":"{'error': \"Invalid budget_duration 'not-a-duration'. Use a format like '1h', '24h', '7d', or '30d'.\"}","type":"auth_error","param":"None","code":"400"}}4.
POST /key/update, badbudget_durationKEY=$(curl -sS -X POST "$PROXY/key/generate" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{}' | jq -r .key){"error":{"message":"{'error': \"Invalid budget_duration 'not-a-duration'. Use a format like '1h', '24h', '7d', or '30d'.\"}","type":"auth_error","param":"None","code":"400"}}5.
POST /organization/member_add, missing org{"error":{"message":"{'error': 'Organization not found for organization_id=no-such-org-qa'}","type":"auth_error","param":"None","code":"404"}}6.
POST /model/delete, missing id{"error":{"message":"{'error': 'Model with id=no-such-model-qa not found in db'}","type":"auth_error","param":"None","code":"400"}}7.
POST /model/update, missing id{"error":{"message":"Authentication Error, model not found","type":"auth_error","param":"None","code":"400"}}8.
POST /model/new, duplicate id{"error":{"message":"{'error': 'Failed to add model to db. Check your server logs for more details.'}","type":"auth_error","param":"None","code":"500"}}9.
GET /health/services, unknown service{"error":{"message":"{'error': \"Service must be in list. Service=not-a-service not in ['agentops', 'anthropic_cache_control_hook', 'argilla', 'arize', 'arize_phoenix', 'aws_sqs', 'azure_sentinel', 'azure_storage', 'bitbucket', 'braintrust', 'clickhouse', 'cloudzero', 'compression_interception', 'custom_callback_api', 'datadog', 'datadog_llm_observability', 'datadog_metrics', 'deepeval', 'dotprompt', 'dynamic_rate_limiter', 'dynamic_rate_limiter_v3', 'email', 'focus', 'galileo', 'gcs_bucket', 'gcs_pubsub', 'generic_api', 'gitlab', 'humanloop', 'lago', 'langfuse', 'langfuse_otel', 'langsmith', 'langtrace', 'levo', 'litellm_agent', 'literalai', 'logfire', 'mavvrik', 'mlflow', 'ms_teams', 'newrelic', 'openmeter', 'opik', 'otel', 'pagerduty', 'pointfive', 'posthog', 'prometheus', 'resend_email', 's3_v2', 'sendgrid_email', 'signoz', 'slack', 'slack_budget_alerts', 'smtp_email', 'sqs', 'ternary', 'vantage', 'vector_store_pre_call_hook', 'weave_otel', 'webhook', 'zerobus']\"}","type":"auth_error","param":"None","code":"400"}}10.
POST /queue/chat/completions, no priority{"error":{"message":"litellm.BadRequestError: priority is required to queue a request, send one or set router_settings.default_priority","type":"invalid_request_error","param":"priority","code":"400"}}11.
POST /queue/chat/completions, unknown model{"error":{"message":"litellm.BadRequestError: You passed in model=no-such-model-qa. There are no healthy deployments for this model\n\nLiteLLM: model group 'no-such-model-qa' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}12.
POST /config/update, non-string callback{"error":{"message":"Authentication Error, unhashable type: 'dict'","type":"auth_error","param":"None","code":"400"}}13.
GET /get/config/callbacks, scalar callback stored{"status":"success","callbacks":[],"alerts":[{"name":"email","variables":{"SMTP_HOST":null,"SMTP_PORT":"587","SMTP_TLS":"True","SMTP_USERNAME":null,"SMTP_PASSWORD":null,"SMTP_SENDER_EMAIL":null,"TEST_EMAIL_ADDRESS":null,"EMAIL_LOGO_URL":null,"EMAIL_SUPPORT_CONTACT":null}},{"name":"ms_teams","variables":{"MS_TEAMS_WEBHOOK_URL":null}}],"active_alerting_destinations":[],"router_settings":{"routing_strategy_args":{},"routing_strategy":"simple-shuffle","allowed_fails":3,"cooldown_time":5,"num_retries":2,"timeout":6000.0,"retry_after":0,"fallbacks":null,"context_window_fallbacks":null,"model_group_retry_policy":{},"retry_policy":null,"model_group_alias":{},"enable_weighted_failover":false,"enable_mid_stream_fallback_continuation":false,"enable_tag_filtering":false,"tag_routing_prefix":"","fallback_on_unsupported_params":true,"routing_groups":[]},"available_callbacks":{"langfuse":{"litellm_callback_name":"langfuse","litellm_callback_params":["LANGFUSE_PUBLIC_KEY","LANGFUSE_SECRET_KEY","LANGFUSE_HOST"],"ui_callback_name":"Langfuse"},"otel":{"litellm_callback_name":"otel","litellm_callback_params":["OTEL_EXPORTER","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_ENDPOINT","OTEL_TRACES_ENDPOINT","OTEL_HEADERS"],"ui_callback_name":"OpenTelemetry"},"s3":{"litellm_callback_name":"s3","litellm_callback_params":["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_REGION_NAME","S3_LOG_PROMPTS_ONLY","S3_PARTITION_GRANULARITY"],"ui_callback_name":"s3 Bucket (AWS)"},"azure_sentinel":{"litellm_callback_name":"azure_sentinel","litellm_callback_params":["AZURE_SENTINEL_DCR_IMMUTABLE_ID","AZURE_SENTINEL_ENDPOINT","AZURE_SENTINEL_TENANT_ID","AZURE_SENTINEL_CLIENT_ID","AZURE_SENTINEL_CLIENT_SECRET","AZURE_SENTINEL_STREAM_NAME"],"ui_callback_name":"Azure Sentinel"},"openmeter":{"litellm_callback_name":"openmeter","litellm_callback_params":["OPENMETER_API_ENDPOINT","OPENMETER_API_KEY"],"ui_callback_name":"OpenMeter"},"custom_callback_api":{"litellm_callback_name":"custom_callback_api","litellm_callback_params":["GENERIC_LOGGER_ENDPOINT","GENERIC_LOGGER_HEADERS"],"ui_callback_name":"Custom Callback API"},"generic_api":{"litellm_callback_name":"generic_api","litellm_callback_params":["GENERIC_LOGGER_ENDPOINT","GENERIC_LOGGER_HEADERS"],"ui_callback_name":"Custom Callback API"},"datadog":{"litellm_callback_name":"datadog","litellm_callback_params":["DD_API_KEY","DD_SITE"],"ui_callback_name":"Datadog"},"braintrust":{"litellm_callback_name":"braintrust","litellm_callback_params":["BRAINTRUST_API_KEY","BRAINTRUST_API_BASE"],"ui_callback_name":"Braintrust"},"langsmith":{"litellm_callback_name":"langsmith","litellm_callback_params":["LANGSMITH_API_KEY","LANGSMITH_PROJECT","LANGSMITH_DEFAULT_RUN_NAME"],"ui_callback_name":"Langsmith"},"lago":{"litellm_callback_name":"lago","litellm_callback_params":["LAGO_API_BASE","LAGO_API_KEY","LAGO_API_EVENT_CODE","LAGO_API_CHARGE_BY"],"ui_callback_name":"Lago Billing"},"traceloop":{"litellm_callback_name":"traceloop","litellm_callback_params":["TRACELOOP_API_KEY"],"ui_callback_name":"Traceloop"},"galileo":{"litellm_callback_name":"galileo","litellm_callback_params":["GALILEO_API_KEY","GALILEO_PROJECT_ID","GALILEO_LOG_STREAM_ID","GALILEO_BASE_URL","GALILEO_USERNAME","GALILEO_PASSWORD"],"ui_callback_name":"Galileo"},"newrelic":{"litellm_callback_name":"newrelic","litellm_callback_params":["NEW_RELIC_AI_MONITORING_RECORD_CONTENT_ENABLED"],"ui_callback_name":"New Relic"},"pointfive":{"litellm_callback_name":"pointfive","litellm_callback_params":["POINTFIVE_API_KEY","POINTFIVE_API_URL"],"ui_callback_name":"PointFive"},"signoz":{"litellm_callback_name":"signoz","litellm_callback_params":["SIGNOZ_INGESTION_ENDPOINT","SIGNOZ_INGESTION_KEY"],"ui_callback_name":"SigNoz"},"zerobus":{"litellm_callback_name":"zerobus","litellm_callback_params":["ZEROBUS_WORKSPACE_URL","ZEROBUS_SERVER_ENDPOINT","ZEROBUS_CLIENT_ID","ZEROBUS_CLIENT_SECRET","ZEROBUS_TABLE_NAME"],"ui_callback_name":"Databricks Zerobus"}}}14.
GET /key/list, badstatus{"error":{"message":"{'error': \"Invalid status value. Supported: 'active', 'expired', 'revoked', 'deleted'.\"}","type":"internal_server_error","param":"None","code":"400"}}15.
GET /team/info, caller outside team{"error":{"message":"{'error': 'User=qa-outsider-1793247467 not authorized to access this team=qa-team-private-1793247467'}","type":"auth_error","param":"None","code":"403"}}16. Control, unknown key
{"error":{"message":"Authentication Error, Invalid API key provided.","type":"token_not_found_in_db","param":"key","code":"401"}}17. Control, wrong UI password
{"error":{"message":"Invalid credentials used to access UI. Check 'UI_USERNAME' and 'UI_PASSWORD', or the password set for your user","type":"auth_error","param":"invalid_credentials","code":"401"}}18.
GET /key/list, database offlineTake the proxy's database offline as in the shared setup, with
ALLOW_CONNECTIONS falseand its open sessions endedRun:
{"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"internal_server_error","param":"None","code":"500"}}19.
GET /key/aliases, database offlineKeep the database offline from case 18
Run:
{"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"internal_server_error","param":"None","code":"500"}}20.
POST /key/update, database offlineKeep the database offline from case 18
Run:
{"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"auth_error","param":"None","code":"400"}}21.
GET /key/list, database host unreachableOn the hop proxy from the shared setup, stop the TCP forwarder so the database host refuses connections
Run:
{"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"internal_server_error","param":"None","code":"500"}}22.
GET /key/aliases, database host unreachableKeep the forwarder stopped from case 21
Run:
{"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"internal_server_error","param":"None","code":"500"}}23.
POST /key/update, database host unreachableKeep the forwarder stopped from case 21
Run:
{"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"auth_error","param":"None","code":"400"}}24.
POST /queue/chat/completions, upstream answers 503Start a local HTTP server on a free port,
$UPSTREAM_PORT, that answers every POST with 503 and{"error":{"message":"upstream overloaded"}}Run:
Wait until six
GET /v1/modelscalls in a row listqa-overloaded-$RUN, so both workers have itRun:
{"error":{"message":"Authentication Error, litellm.ServiceUnavailableError: ServiceUnavailableError: OpenAIException - upstream overloaded\n\nLiteLLM: model group 'qa-overloaded-1793247570' failed with the error above. No fallback was attempted. LiteLLM Retried: 2 times, LiteLLM Max Retries: 2","type":"auth_error","param":null,"code":"400"}}25.
GET /get/config/callbacks, config file emptiedEmpty the proxy's config file in place, then restore it right after the call
Run:
{"error":{"message":"Authentication Error, Config cannot be None or Empty.","type":"auth_error","param":"None","code":"400"}}26.
POST /key/update, team table locked{"error":{"message":"{'error': \"Team doesn't exist in db. Team=qa-team-stall-1793247570. Create team via `/team/new` call.\"}","type":"auth_error","param":"None","code":"404"}}27.
POST /queue/chat/completions, Anthropic answers 404Wait until six
GET /v1/modelscalls in a row listqa-retired-$RUN, a model name Anthropic does not serve, so both workers have itRun:
{"error":{"message":"Authentication Error, litellm.NotFoundError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"not_found_error\",\"message\":\"model: claude-retired-qa-1793247826\"},\"request_id\":\"req_011CgVtgDpAH7JmeDi34RpEG\"}\n\nLiteLLM: model group 'qa-retired-1793247826' failed with the error above. No fallback was attempted.","type":"auth_error","param":null,"code":"400"}}28.
POST /queue/chat/completions, Anthropic answers{"id":"chatcmpl-be86b328-4bf2-423a-989c-637218366355","created":1793247852,"model":"claude-haiku-5-5","object":"chat.completion","system_fingerprint":null,"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Pong","role":"assistant","tool_calls":null,"function_call":null,"provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":5,"prompt_tokens":17,"total_tokens":22,"completion_tokens_details":{"accepted_prediction_tokens":null,"audio_tokens":null,"reasoning_tokens":0,"rejected_prediction_tokens":null,"text_tokens":5,"image_tokens":null,"video_tokens":null},"prompt_tokens_details":{"audio_tokens":null,"cached_tokens":0,"text_tokens":17,"image_tokens":null,"video_tokens":null,"initial_prompt_tokens":null,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_30m_input_tokens":null,"ephemeral_1h_input_tokens":0,"ephemeral_12h_input_tokens":null}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"iterations":null,"inference_geo":"global","speed":"standard","service_tier":"standard"}}29.
POST /model/new, database host unreachableKeep the forwarder stopped from case 21
Run:
{"error":{"message":"{'error': 'Failed to add model to db. Check your server logs for more details.'}","type":"auth_error","param":"None","code":"500"}}30.
POST /queue/chat/completions, Anthropic rejects the keyWait until six
GET /v1/modelscalls in a row listqa-badkey-$RUN, aclaude-haiku-5-5deployment with an Anthropic key Anthropic rejects, so both workers have itRun:
{"error":{"message":"Authentication Error, litellm.AuthenticationError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"invalid x-api-key\"},\"request_id\":\"req_011CgVti5jnz7hPUNsti8Ciw\"}\n\nLiteLLM: model group 'qa-badkey-1793247854' failed with the error above. No fallback was attempted.","type":"auth_error","param":null,"code":"400"}}31.
POST /key/update, database failed over to read-onlyKEY=$(curl -sS -X POST "$PROXY/key/generate" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{}' | jq -r .key){"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"auth_error","param":"None","code":"400"}}32.
POST /key/update, reconnected read-only sessionKeep the database read-only from case 31, so the next call runs on a reconnected session that rejects writes
Run:
{"error":{"message":"Authentication Error, 'NoneType' object has no attribute 'get'","type":"auth_error","param":"None","code":"400"}}After (9f25ff8)
2.
GET /team/info, missing team{"error":{"message":"{'message': 'Team not found, passed team id: no-such-team-qa.'}","type":"invalid_request_error","param":null,"code":"404"}}The other 31 cases
1. Sanity, real Anthropic call
{"id":"chatcmpl-1e313416-7cf9-4e6e-96d0-b054f3d1e0c0","created":1793247469,"model":"claude-haiku-5-5","object":"chat.completion","choices":[{"finish_reason":"stop","index":0,"message":{"content":"slp-qa-ok","role":"assistant","provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":10,"prompt_tokens":22,"total_tokens":32,"completion_tokens_details":{"reasoning_tokens":0,"text_tokens":10},"prompt_tokens_details":{"cached_tokens":0,"text_tokens":22,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"inference_geo":"global","speed":"standard","service_tier":"standard"}}3.
POST /user/update, badbudget_duration{"error":{"message":"{'error': \"Invalid budget_duration 'not-a-duration'. Use a format like '1h', '24h', '7d', or '30d'.\"}","type":"invalid_request_error","param":null,"code":"400"}}4.
POST /key/update, badbudget_durationKEY=$(curl -sS -X POST "$PROXY/key/generate" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{}' | jq -r .key){"error":{"message":"{'error': \"Invalid budget_duration 'not-a-duration'. Use a format like '1h', '24h', '7d', or '30d'.\"}","type":"invalid_request_error","param":null,"code":"400"}}5.
POST /organization/member_add, missing org{"error":{"message":"{'error': 'Organization not found for organization_id=no-such-org-qa'}","type":"invalid_request_error","param":null,"code":"404"}}6.
POST /model/delete, missing id{"error":{"message":"{'error': 'Model with id=no-such-model-qa not found in db'}","type":"invalid_request_error","param":null,"code":"400"}}7.
POST /model/update, missing id{"error":{"message":"model not found","type":"invalid_request_error","param":null,"code":"400"}}8.
POST /model/new, duplicate id{"error":{"message":"{'error': 'Failed to add model to db. Check your server logs for more details.'}","type":"internal_server_error","param":null,"code":"500"}}9.
GET /health/services, unknown service{"error":{"message":"{'error': \"Service must be in list. Service=not-a-service not in ['agentops', 'anthropic_cache_control_hook', 'argilla', 'arize', 'arize_phoenix', 'aws_sqs', 'azure_sentinel', 'azure_storage', 'bitbucket', 'braintrust', 'clickhouse', 'cloudzero', 'compression_interception', 'custom_callback_api', 'datadog', 'datadog_llm_observability', 'datadog_metrics', 'deepeval', 'dotprompt', 'dynamic_rate_limiter', 'dynamic_rate_limiter_v3', 'email', 'focus', 'galileo', 'gcs_bucket', 'gcs_pubsub', 'generic_api', 'gitlab', 'humanloop', 'lago', 'langfuse', 'langfuse_otel', 'langsmith', 'langtrace', 'levo', 'litellm_agent', 'literalai', 'logfire', 'mavvrik', 'mlflow', 'ms_teams', 'newrelic', 'openmeter', 'opik', 'otel', 'pagerduty', 'pointfive', 'posthog', 'prometheus', 'resend_email', 's3_v2', 'sendgrid_email', 'signoz', 'slack', 'slack_budget_alerts', 'smtp_email', 'sqs', 'ternary', 'vantage', 'vector_store_pre_call_hook', 'weave_otel', 'webhook', 'zerobus']\"}","type":"invalid_request_error","param":null,"code":"400"}}10.
POST /queue/chat/completions, no priority{"error":{"message":"litellm.BadRequestError: priority is required to queue a request, send one or set router_settings.default_priority","type":"invalid_request_error","param":"priority","code":"400"}}11.
POST /queue/chat/completions, unknown model{"error":{"message":"litellm.BadRequestError: You passed in model=no-such-model-qa. There are no healthy deployments for this model\n\nLiteLLM: model group 'no-such-model-qa' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"400"}}12.
POST /config/update, non-string callback{"error":{"message":"unhashable type: 'dict'","type":"invalid_request_error","param":null,"code":"400"}}13.
GET /get/config/callbacks, scalar callback stored{"status":"success","callbacks":[],"alerts":[{"name":"email","variables":{"SMTP_HOST":null,"SMTP_PORT":"587","SMTP_TLS":"True","SMTP_USERNAME":null,"SMTP_PASSWORD":null,"SMTP_SENDER_EMAIL":null,"TEST_EMAIL_ADDRESS":null,"EMAIL_LOGO_URL":null,"EMAIL_SUPPORT_CONTACT":null}},{"name":"ms_teams","variables":{"MS_TEAMS_WEBHOOK_URL":null}}],"active_alerting_destinations":[],"router_settings":{"routing_strategy_args":{},"routing_strategy":"simple-shuffle","allowed_fails":3,"cooldown_time":5,"num_retries":2,"timeout":6000.0,"retry_after":0,"fallbacks":null,"context_window_fallbacks":null,"model_group_retry_policy":{},"retry_policy":null,"model_group_alias":{},"enable_weighted_failover":false,"enable_mid_stream_fallback_continuation":false,"enable_tag_filtering":false,"tag_routing_prefix":"","fallback_on_unsupported_params":true,"routing_groups":[]},"available_callbacks":{"langfuse":{"litellm_callback_name":"langfuse","litellm_callback_params":["LANGFUSE_PUBLIC_KEY","LANGFUSE_SECRET_KEY","LANGFUSE_HOST"],"ui_callback_name":"Langfuse"},"otel":{"litellm_callback_name":"otel","litellm_callback_params":["OTEL_EXPORTER","OTEL_EXPORTER_OTLP_PROTOCOL","OTEL_ENDPOINT","OTEL_TRACES_ENDPOINT","OTEL_HEADERS"],"ui_callback_name":"OpenTelemetry"},"s3":{"litellm_callback_name":"s3","litellm_callback_params":["AWS_ACCESS_KEY_ID","AWS_SECRET_ACCESS_KEY","AWS_REGION_NAME","S3_LOG_PROMPTS_ONLY","S3_PARTITION_GRANULARITY"],"ui_callback_name":"s3 Bucket (AWS)"},"azure_sentinel":{"litellm_callback_name":"azure_sentinel","litellm_callback_params":["AZURE_SENTINEL_DCR_IMMUTABLE_ID","AZURE_SENTINEL_ENDPOINT","AZURE_SENTINEL_TENANT_ID","AZURE_SENTINEL_CLIENT_ID","AZURE_SENTINEL_CLIENT_SECRET","AZURE_SENTINEL_STREAM_NAME"],"ui_callback_name":"Azure Sentinel"},"openmeter":{"litellm_callback_name":"openmeter","litellm_callback_params":["OPENMETER_API_ENDPOINT","OPENMETER_API_KEY"],"ui_callback_name":"OpenMeter"},"custom_callback_api":{"litellm_callback_name":"custom_callback_api","litellm_callback_params":["GENERIC_LOGGER_ENDPOINT","GENERIC_LOGGER_HEADERS"],"ui_callback_name":"Custom Callback API"},"generic_api":{"litellm_callback_name":"generic_api","litellm_callback_params":["GENERIC_LOGGER_ENDPOINT","GENERIC_LOGGER_HEADERS"],"ui_callback_name":"Custom Callback API"},"datadog":{"litellm_callback_name":"datadog","litellm_callback_params":["DD_API_KEY","DD_SITE"],"ui_callback_name":"Datadog"},"braintrust":{"litellm_callback_name":"braintrust","litellm_callback_params":["BRAINTRUST_API_KEY","BRAINTRUST_API_BASE"],"ui_callback_name":"Braintrust"},"langsmith":{"litellm_callback_name":"langsmith","litellm_callback_params":["LANGSMITH_API_KEY","LANGSMITH_PROJECT","LANGSMITH_DEFAULT_RUN_NAME"],"ui_callback_name":"Langsmith"},"lago":{"litellm_callback_name":"lago","litellm_callback_params":["LAGO_API_BASE","LAGO_API_KEY","LAGO_API_EVENT_CODE","LAGO_API_CHARGE_BY"],"ui_callback_name":"Lago Billing"},"traceloop":{"litellm_callback_name":"traceloop","litellm_callback_params":["TRACELOOP_API_KEY"],"ui_callback_name":"Traceloop"},"galileo":{"litellm_callback_name":"galileo","litellm_callback_params":["GALILEO_API_KEY","GALILEO_PROJECT_ID","GALILEO_LOG_STREAM_ID","GALILEO_BASE_URL","GALILEO_USERNAME","GALILEO_PASSWORD"],"ui_callback_name":"Galileo"},"newrelic":{"litellm_callback_name":"newrelic","litellm_callback_params":["NEW_RELIC_AI_MONITORING_RECORD_CONTENT_ENABLED"],"ui_callback_name":"New Relic"},"pointfive":{"litellm_callback_name":"pointfive","litellm_callback_params":["POINTFIVE_API_KEY","POINTFIVE_API_URL"],"ui_callback_name":"PointFive"},"signoz":{"litellm_callback_name":"signoz","litellm_callback_params":["SIGNOZ_INGESTION_ENDPOINT","SIGNOZ_INGESTION_KEY"],"ui_callback_name":"SigNoz"},"zerobus":{"litellm_callback_name":"zerobus","litellm_callback_params":["ZEROBUS_WORKSPACE_URL","ZEROBUS_SERVER_ENDPOINT","ZEROBUS_CLIENT_ID","ZEROBUS_CLIENT_SECRET","ZEROBUS_TABLE_NAME"],"ui_callback_name":"Databricks Zerobus"}}}14.
GET /key/list, badstatus{"error":{"message":"{'error': \"Invalid status value. Supported: 'active', 'expired', 'revoked', 'deleted'.\"}","type":"invalid_request_error","param":null,"code":"400"}}15.
GET /team/info, caller outside team{"error":{"message":"{'error': 'User=qa-outsider-1793247467 not authorized to access this team=qa-team-private-1793247467'}","type":"auth_error","param":null,"code":"403"}}16. Control, unknown key
{"error":{"message":"Authentication Error, Invalid API key provided.","type":"token_not_found_in_db","param":"key","code":"401"}}17. Control, wrong UI password
{"error":{"message":"Invalid credentials used to access UI. Check 'UI_USERNAME' and 'UI_PASSWORD', or the password set for your user","type":"auth_error","param":"invalid_credentials","code":"401"}}18.
GET /key/list, database offlineTake the proxy's database offline as in the shared setup, with
ALLOW_CONNECTIONS falseand its open sessions endedRun:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}19.
GET /key/aliases, database offlineKeep the database offline from case 18
Run:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}20.
POST /key/update, database offlineKeep the database offline from case 18
Run:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}21.
GET /key/list, database host unreachableOn the hop proxy from the shared setup, stop the TCP forwarder so the database host refuses connections
Run:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}22.
GET /key/aliases, database host unreachableKeep the forwarder stopped from case 21
Run:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}23.
POST /key/update, database host unreachableKeep the forwarder stopped from case 21
Run:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}24.
POST /queue/chat/completions, upstream answers 503Start a local HTTP server on a free port,
$UPSTREAM_PORT, that answers every POST with 503 and{"error":{"message":"upstream overloaded"}}Run:
Wait until six
GET /v1/modelscalls in a row listqa-overloaded-$RUN, so both workers have itRun:
{"error":{"message":"litellm.ServiceUnavailableError: ServiceUnavailableError: OpenAIException - upstream overloaded\n\nLiteLLM: model group 'qa-overloaded-1793247552' failed with the error above. No fallback was attempted. LiteLLM Retried: 2 times, LiteLLM Max Retries: 2","type":"internal_server_error","param":null,"code":"503"}}25.
GET /get/config/callbacks, config file emptiedEmpty the proxy's config file in place, then restore it right after the call
Run:
{"error":{"message":"Config cannot be None or Empty.","type":"internal_server_error","param":null,"code":"500"}}26.
POST /key/update, team table locked{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}27.
POST /queue/chat/completions, Anthropic answers 404Wait until six
GET /v1/modelscalls in a row listqa-retired-$RUN, a model name Anthropic does not serve, so both workers have itRun:
{"error":{"message":"litellm.NotFoundError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"not_found_error\",\"message\":\"model: claude-retired-qa-1793247827\"},\"request_id\":\"req_011CgVthVsLNbQykLsqKDeGh\"}\n\nLiteLLM: model group 'qa-retired-1793247827' failed with the error above. No fallback was attempted.","type":"invalid_request_error","param":null,"code":"404"}}28.
POST /queue/chat/completions, Anthropic answers{"id":"chatcmpl-0a64007e-6cf4-499a-a2c5-cea0fd718275","created":1793247869,"model":"claude-haiku-5-5","object":"chat.completion","system_fingerprint":null,"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Pong","role":"assistant","tool_calls":null,"function_call":null,"provider_specific_fields":{"citations":null,"thinking_blocks":null}}}],"usage":{"completion_tokens":5,"prompt_tokens":17,"total_tokens":22,"completion_tokens_details":{"accepted_prediction_tokens":null,"audio_tokens":null,"reasoning_tokens":0,"rejected_prediction_tokens":null,"text_tokens":5,"image_tokens":null,"video_tokens":null},"prompt_tokens_details":{"audio_tokens":null,"cached_tokens":0,"text_tokens":17,"image_tokens":null,"video_tokens":null,"initial_prompt_tokens":null,"cache_write_tokens":0,"cache_creation_tokens":0,"cache_creation_token_details":{"ephemeral_5m_input_tokens":0,"ephemeral_30m_input_tokens":null,"ephemeral_1h_input_tokens":0,"ephemeral_12h_input_tokens":null}},"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"iterations":null,"inference_geo":"global","speed":"standard","service_tier":"standard"}}29.
POST /model/new, database host unreachableKeep the forwarder stopped from case 21
Run:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}30.
POST /queue/chat/completions, Anthropic rejects the keyWait until six
GET /v1/modelscalls in a row listqa-badkey-$RUN, aclaude-haiku-5-5deployment with an Anthropic key Anthropic rejects, so both workers have itRun:
{"error":{"message":"litellm.AuthenticationError: AnthropicException - {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"invalid x-api-key\"},\"request_id\":\"req_011CgVtjftQ1zzNT6sAniWp7\"}\n\nLiteLLM: model group 'qa-badkey-1793247871' failed with the error above. No fallback was attempted.","type":"authentication_error","param":null,"code":"401"}}31.
POST /key/update, database failed over to read-onlyKEY=$(curl -sS -X POST "$PROXY/key/generate" -H "Authorization: Bearer $LITELLM_MASTER_KEY" -H 'Content-Type: application/json' -d '{}' | jq -r .key){"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}32.
POST /key/update, reconnected read-only sessionKeep the database read-only from case 31, so the next call runs on a reconnected session that rejects writes
Run:
{"error":{"message":"Service Unavailable, the authentication database is temporarily unreachable. Please retry shortly.","type":"no_db_connection","param":null,"code":"503"}}Observations from the run:
BadRequestErroranswers already saidinvalid_request_error/chat/completions/model/newonce found no deployment/live-pr-risk report
Verdict at 1bd8ecf: nothing breaks. Every dependent the run reached answers as on c7c895d apart from the relabels below
Breaking. None observed
Backward incompatible
invalid_request_errororinternal_server_error, notauth_error. Asked for by the PR's owner in the ticket behind this PRparamis null, not"None". The ticket's After body asks for the OpenAI shape, which typesparamas nullableno_db_connection, so the dashboard's key edit toast says the database is unreachable where main showed aNoneTypeerror. The auth path already answers 503 for an outage, and the owner's standing rule says an existing convention settles this/chat/completionsalready does, settled by the same ruleRegression risk
/queue/chat/completionslatency metric buckets by the new statusteam_member_updatereachesteam_info's 404 only if the team vanishes between its two reads/team/infoon 500 and 503 through React QueryDependency graph
auth_errorand"None"expectations updated in 873d6df, passed on a head rerun, or failed on base the same way, like the/openapi.jsonread timeouts in the stored config slot testskeys.updateon a missing key,/loginacross a read-only failover, and the dashboard key edit during a failoverCarried to 9f25ff8. 873d6df changes only integration test expectations, and the 12 updated tests pass on the head rig. 9f25ff8 merges main at 83ae1bd, whose only conflict was two new tests added at the end of the same file. Both QA legs ran again on the merged tree and its new base, every case answers as it did at 1bd8ecf except two
/chat/completionscomparison calls that router cooldown decides, and the unit tests of the merged files passNot verified. The OTel hook, the queue metric and the React Query retry, for want of an OTel backend and a metrics scrape in the rig
Type
🐛 Bug Fix
Caveats (if any)
Low
POST /model/newsays to retry, and SDKs already retried main's 500 there/health/serviceswebhook timeout answers 408, not 500invalid_request_error, as on mainFinal Attestation
Bugbot summary