BerriAI/litellm · error · HTTPException
Internal server error: {e}
Error message
Internal server error: {e} What it means
Catch-all wrapper raised by an agent management endpoint when an unexpected exception escapes the handler body; the original error's text is embedded in the HTTP 500 detail. It marks an unhandled server-side failure (usually database or serialization) rather than any client-input problem — the chained exception in the logs holds the real cause.
Source
Thrown at litellm/proxy/agent_endpoints/endpoints.py:344
AGENT_HEALTH_CHECK_GATHER_TIMEOUT_SECONDS,
)
health_results = [
{
"agent_id": agent.agent_id,
"healthy": False,
"error": "Health check timed out",
}
for agent in agents_with_url
]
healthy_ids: Final = {result["agent_id"] for result in health_results if result["healthy"]}
returned_agents = [agent for agent in agents_with_url if agent.agent_id in healthy_ids] + agents_without_url
return returned_agents
except HTTPException:
raise
except Exception as e:
verbose_proxy_logger.exception("litellm.proxy.agent_endpoints.get_agents(): Exception occurred - %s", e)
raise HTTPException(status_code=500, detail={"error": f"Internal server error: {e}"})
#### CRUD ENDPOINTS FOR AGENTS ####
from litellm.proxy.agent_endpoints.agent_registry import (
agents_table,
)
from litellm.proxy.agent_endpoints.agent_registry import (
global_agent_registry as AGENT_REGISTRY,
)
@router.post(
"/v1/agents",
tags=["[beta] A2A Agents"],
dependencies=[Depends(user_api_key_auth)],
response_model=AgentResponse,
)View on GitHub (pinned to 77b7c6c40c)
Solutions
- Check proxy logs for the exception detail; validate the request payload.
Example fix
Inspect server logs for the stack trace.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/proxy/agent_endpoints/endpoints.py:344 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/e9abdc266e2aef2f.
Report an issue: GitHub.