BerriAI/litellm · error · HTTPException

Database not connected.

Error message

Database not connected.

What it means

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.

Source

Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:496

):
    """
    List all access groups.
    
    Returns a list of all access groups with their model names and deployment counts.
    
    Example:
    ```bash
    curl -X GET 'http://localhost:4000/access_group/list' \\
      -H 'Authorization: Bearer sk-1234'
    ```
    
    Returns:
    - ListAccessGroupsResponse with all access groups
    """
    from litellm.proxy.proxy_server import prisma_client

    if prisma_client is None:
        raise HTTPException(
            status_code=500,
            detail={"error": "Database not connected."},
        )

    try:
        access_groups_map: Final = await get_all_access_groups_from_db(prisma_client=prisma_client)

        # Sort by access group name
        access_groups_list: Final = sorted(
            access_groups_map.values(),
            key=lambda x: x.access_group,
        )

        return ListAccessGroupsResponse(access_groups=access_groups_list)

    except Exception as e:
        verbose_proxy_logger.exception("Error listing access groups: %s", e)
        raise HTTPException(

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set DATABASE_URL to a PostgreSQL connection string and restart the proxy.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/model_access_group_management_endpoints.py:496 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/a57e0cbf2eac9f9d. Report an issue: GitHub.