BerriAI/litellm · error · Exception
Error updating agent in DB: {e}
Error message
Error updating agent in DB: {e} What it means
Generic wrapper raised in the agent update path when the prisma agents_table().update (or serialization of the updated row) throws; original exception text is interpolated. This is the full-update counterpart of the patch/add wrappers in the same registry: it means the agent exists and update_data was prepared, but the database write itself failed at the infrastructure level.
Source
Thrown at litellm/proxy/agent_endpoints/agent_registry.py:534
if object_permission_id is not None:
update_data["object_permission_id"] = object_permission_id
# Update agent in DB
updated_agent: Final = await agents_table(prisma_client).update(
where={"agent_id": agent_id},
data=update_data,
include={"object_permission": True},
)
updated_agent_dict: Final = updated_agent.model_dump()
if updated_agent.object_permission is not None:
try:
updated_agent_dict["object_permission"] = updated_agent.object_permission.model_dump()
except Exception:
updated_agent_dict["object_permission"] = updated_agent.object_permission.dict()
return AgentResponse(**updated_agent_dict)
except Exception as e:
raise Exception(f"Error updating agent in DB: {e}")
@staticmethod
async def get_all_agents_from_db(
prisma_client: PrismaClient,
) -> list[dict[str, object]]:
"""
Get all agents from the database
"""
try:
agents_from_db: Final = await agents_table(prisma_client).find_many(
order={"created_at": "desc"},
include={"object_permission": True},
)
agents: Final[list[dict[str, object]]] = []
for agent in agents_from_db:
agent_dict = dict(agent)
# object_permission is eagerly loaded via include aboveView on GitHub (pinned to 77b7c6c40c)
Solutions
- Check the database error detail; validate the update payload.
Example fix
Check proxy logs for the DB error.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/proxy/agent_endpoints/agent_registry.py:534 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/2c6f52c5de4697d6.
Report an issue: GitHub.