BerriAI/litellm · error · HTTPException

Failed to fetch per-user analytics: {e}

Error message

Failed to fetch per-user analytics: {e}

What it means

HTTPException wrapping any unexpected exception while computing per-user analytics (aggregation or in-memory pagination over tag-spend rows). The exception text is embedded and the per-user endpoint aborts; distinct from the 400 raised for bad date inputs.

Source

Thrown at litellm/proxy/management_endpoints/user_agent_analytics_endpoints.py:798

        )

        # Apply pagination
        total_count: Final = len(results)
        total_pages: Final = (total_count + page_size - 1) // page_size
        start_idx: Final = (page - 1) * page_size
        end_idx: Final = start_idx + page_size
        paginated_results: Final = results[start_idx:end_idx]

        return PerUserAnalyticsResponse(
            results=paginated_results,
            total_count=total_count,
            page=page,
            page_size=page_size,
            total_pages=total_pages,
        )

    except Exception as e:
        raise HTTPException(
            status_code=500,
            detail=f"Failed to fetch per-user analytics: {e}",
        )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Check the embedded error and proxy logs; verify the database connection and query parameters, then retry.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/user_agent_analytics_endpoints.py:798 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/d5d348d2476f5db0. Report an issue: GitHub.