BerriAI/litellm · error · HTTPException

Failed to list JWT key mappings.

Error message

Failed to list JWT key mappings.

What it means

Error "Failed to list JWT key mappings." thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/jwt_key_mapping_endpoints.py:213

    try:
        skip: Final = (page - 1) * size
        mappings: Final = await JWTKeyMappingRepository(prisma_client).table.find_many(
            skip=skip,
            take=size,
            order={"created_at": "desc"},
        )
        total_count: Final = await JWTKeyMappingRepository(prisma_client).table.count()
        return {
            "mappings": [_to_response(m) for m in mappings],
            "total_count": total_count,
            "current_page": page,
            "total_pages": -(-total_count // size),  # ceiling division
        }
    except HTTPException:
        raise
    except Exception:
        raise HTTPException(status_code=500, detail="Failed to list JWT key mappings.")


@router.get(
    "/jwt/key/mapping/info",
    tags=["JWT Key Mapping"],
    response_model=JWTKeyMappingResponse,
)
async def info_jwt_key_mapping(
    id: str,
    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
    from litellm.proxy.proxy_server import prisma_client

    # Admin Viewer follows the read-parity rule.
    if not _user_has_admin_view(user_api_key_dict):
        raise HTTPException(status_code=403, detail="Only proxy admins can get JWT key mapping info")

    if prisma_client is None:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Check proxy logs for the underlying database error.
  2. Verify the database connection is healthy, then retry.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/jwt_key_mapping_endpoints.py:213 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/462e7566fcec4b40. Report an issue: GitHub.