{"record":{"id":"2c6f52c5de4697d6","repo":"BerriAI/litellm","slug":"error-updating-agent-in-db-e","errorCode":null,"errorMessage":"Error updating agent in DB: {e}","messagePattern":"Error updating agent in DB: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/proxy/agent_endpoints/agent_registry.py","lineNumber":534,"sourceCode":"                if object_permission_id is not None:\n                    update_data[\"object_permission_id\"] = object_permission_id\n\n            # Update agent in DB\n            updated_agent: Final = await agents_table(prisma_client).update(\n                where={\"agent_id\": agent_id},\n                data=update_data,\n                include={\"object_permission\": True},\n            )\n\n            updated_agent_dict: Final = updated_agent.model_dump()\n            if updated_agent.object_permission is not None:\n                try:\n                    updated_agent_dict[\"object_permission\"] = updated_agent.object_permission.model_dump()\n                except Exception:\n                    updated_agent_dict[\"object_permission\"] = updated_agent.object_permission.dict()\n            return AgentResponse(**updated_agent_dict)\n        except Exception as e:\n            raise Exception(f\"Error updating agent in DB: {e}\")\n\n    @staticmethod\n    async def get_all_agents_from_db(\n        prisma_client: PrismaClient,\n    ) -> list[dict[str, object]]:\n        \"\"\"\n        Get all agents from the database\n        \"\"\"\n        try:\n            agents_from_db: Final = await agents_table(prisma_client).find_many(\n                order={\"created_at\": \"desc\"},\n                include={\"object_permission\": True},\n            )\n\n            agents: Final[list[dict[str, object]]] = []\n            for agent in agents_from_db:\n                agent_dict = dict(agent)\n                # object_permission is eagerly loaded via include above","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/agent_registry.py#L516-L552","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/agent_registry.py:534 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the database error detail; validate the update payload."],"exampleFix":"Check proxy logs for the DB error.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}