{"record":{"id":"2f4f7917803a65af","repo":"BerriAI/litellm","slug":"prisma-client-not-initialized","errorCode":null,"errorMessage":"Prisma client not initialized","messagePattern":"Prisma client not initialized","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/agent_endpoints/endpoints.py","lineNumber":412,"sourceCode":"                        \"tags\": [\"hello world\"],\n                        \"examples\": [\"hi\", \"hello world\"]\n                    }\n                ]\n            },\n            \"litellm_params\": {\n                \"make_public\": true\n            }\n        }'\n    ```\n    \"\"\"\n    await check_feature_access_for_user(user_api_key_dict, \"agents\")\n\n    from litellm.proxy.proxy_server import prisma_client\n\n    _check_agent_management_permission(user_api_key_dict)\n\n    if prisma_client is None:\n        raise HTTPException(status_code=500, detail=\"Prisma client not initialized\")\n\n    try:\n        # Get the user ID from the API key auth\n        created_by: Final = user_api_key_dict.user_id or \"unknown\"\n\n        # check for naming conflicts\n        existing_agent: Final = AGENT_REGISTRY.get_agent_by_name(agent_name=request.get(\"agent_name\"))\n        if existing_agent is not None:\n            raise HTTPException(\n                status_code=400,\n                detail=f\"Agent with name {request.get('agent_name')} already exists\",\n            )\n\n        # Apply the LiteLLM-fronting merge only when the admin actually\n        # provided an agent card. Plain chat/LLM agents register without\n        # ``agent_card_params``, and synthesising a default A2A card for them\n        # would advertise capabilities (``supportedInterfaces``, security\n        # schemes, default skills) the agent doesn't actually expose.","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/agent_endpoints/endpoints.py#L394-L430","documentation":"Raised in the agent creation endpoint when the proxy_server.prisma_client singleton is None — the proxy started without DATABASE_URL, so there is no database to persist agents in. Returned as HTTP 500; the fix is connecting a Postgres database to the proxy, not changing the request.","triggerScenarios":"Thrown at litellm/proxy/agent_endpoints/endpoints.py:412 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Connect a database (set DATABASE_URL) so the Prisma client initializes."],"exampleFix":"export DATABASE_URL='postgresql://...'","handlingStrategy":"validation","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-14T00:17:10.932Z"}