{"record":{"id":"afd61d25d6eaa6c2","repo":"BerriAI/litellm","slug":"invalid-date-format-use-yyyy-mm-dd-e","errorCode":null,"errorMessage":"Invalid date format. Use YYYY-MM-DD: {e}","messagePattern":"Invalid date format\\. Use YYYY-MM-DD: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/user_agent_analytics_endpoints.py","lineNumber":641,"sourceCode":"        db_response: Final = _TAG_SUMMARY_ROWS.validate_python(await _query_raw(prisma_client, sql_query, *params))\n\n        results: Final = [\n            TagSummaryMetrics(\n                tag=row.tag,\n                unique_users=row.unique_users or 0,\n                total_requests=int(row.total_requests or 0),\n                successful_requests=int(row.successful_requests or 0),\n                failed_requests=int(row.failed_requests or 0),\n                total_tokens=int(row.total_tokens or 0),\n                total_spend=float(row.total_spend or 0.0),\n            )\n            for row in db_response\n        ]\n\n        return TagSummaryResponse(results=results)\n\n    except ValueError as e:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Invalid date format. Use YYYY-MM-DD: {e}\",\n        )\n    except Exception as e:\n        raise HTTPException(\n            status_code=500,\n            detail=f\"Failed to fetch tag summary analytics: {e}\",\n        )\n\n\n@router.get(\n    \"/tag/user-agent/per-user-analytics\",\n    response_model=PerUserAnalyticsResponse,\n    tags=[\"tag management\", \"user agent analytics\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def get_per_user_analytics(\n    tag_filter: str | None = Query(","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/user_agent_analytics_endpoints.py#L623-L659","documentation":"HTTPException(400) raised in the tag-summary analytics endpoint when parsing a start/end date parameter fails — the value does not match the YYYY-MM-DD format expected by datetime.strptime. The parse error text is embedded so the caller sees which value was rejected.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/user_agent_analytics_endpoints.py:641 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass dates in YYYY-MM-DD format."],"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-14T00:17:10.932Z"}