{"record":{"id":"a57e0cbf2eac9f9d","repo":"BerriAI/litellm","slug":"database-not-connected-a57e0c","errorCode":null,"errorMessage":"Database not connected.","messagePattern":"Database not connected\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_access_group_management_endpoints.py","lineNumber":496,"sourceCode":"):\n    \"\"\"\n    List all access groups.\n    \n    Returns a list of all access groups with their model names and deployment counts.\n    \n    Example:\n    ```bash\n    curl -X GET 'http://localhost:4000/access_group/list' \\\\\n      -H 'Authorization: Bearer sk-1234'\n    ```\n    \n    Returns:\n    - ListAccessGroupsResponse with all access groups\n    \"\"\"\n    from litellm.proxy.proxy_server import prisma_client\n\n    if prisma_client is None:\n        raise HTTPException(\n            status_code=500,\n            detail={\"error\": \"Database not connected.\"},\n        )\n\n    try:\n        access_groups_map: Final = await get_all_access_groups_from_db(prisma_client=prisma_client)\n\n        # Sort by access group name\n        access_groups_list: Final = sorted(\n            access_groups_map.values(),\n            key=lambda x: x.access_group,\n        )\n\n        return ListAccessGroupsResponse(access_groups=access_groups_list)\n\n    except Exception as e:\n        verbose_proxy_logger.exception(\"Error listing access groups: %s\", e)\n        raise HTTPException(","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_access_group_management_endpoints.py#L478-L514","documentation":"Guard in the access-group list endpoint: prisma_client is None, so group membership data cannot be read; a database must be connected to the proxy.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:496 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set DATABASE_URL to a PostgreSQL connection string and restart the proxy."],"exampleFix":null,"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-14T05:17:10.506Z"}