{"record":{"id":"176a3fae62264bb8","repo":"BerriAI/litellm","slug":"team-metadata-failed-validation","errorCode":null,"errorMessage":"Team metadata failed validation.","messagePattern":"Team metadata failed validation\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_helpers/team_metadata_validation.py","lineNumber":138,"sourceCode":"    ):\n        raise HTTPException(\n            status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n            detail={  # mutable-ok: HTTPException.detail has no immutable form\n                \"error\": \"custom_team_metadata_validate must be an async function\"\n            },\n        )\n\n    try:\n        raw_result: Final = await asyncio.wait_for(validator(payload), timeout=timeout_seconds)\n        result: Final = TeamMetadataValidationResult.model_validate(raw_result)\n    except Exception:  # noqa: BLE001  # fail closed: any validator failure must block the team write\n        raise HTTPException(\n            status_code=status.HTTP_503_SERVICE_UNAVAILABLE,\n            detail={\"error\": unavailable_message},  # mutable-ok: HTTPException.detail has no immutable form\n        )\n\n    if not result.valid:\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail={  # mutable-ok: HTTPException.detail has no immutable form\n                \"error\": result.error_message or DEFAULT_TEAM_METADATA_VALIDATION_REJECTED_MESSAGE\n            },\n        )\n\n\ndef _read_timeout_seconds(general_settings: Mapping[str, object]) -> float:\n    raw_timeout: Final = general_settings.get(\"team_metadata_validation_timeout\")\n    if isinstance(raw_timeout, (int, float)) and not isinstance(raw_timeout, bool) and raw_timeout > 0:\n        return float(raw_timeout)\n    return DEFAULT_TEAM_METADATA_VALIDATION_TIMEOUT_SECONDS\n\n\ndef _read_unavailable_message(general_settings: Mapping[str, object]) -> str:\n    raw_message: Final = general_settings.get(\"team_metadata_validation_error_message\")\n    if isinstance(raw_message, str) and raw_message.strip():\n        return raw_message","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_helpers/team_metadata_validation.py#L120-L156","documentation":"HTTPException raised after the custom team-metadata validator ran but rejected the payload (returned an invalid result or threw): the submitted team metadata did not satisfy the enterprise validation hook. Any validator failure blocks the team write (fail closed); this message covers the rejection case.","triggerScenarios":"Thrown at litellm/proxy/management_helpers/team_metadata_validation.py:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the team metadata to satisfy the configured validation schema/callback, then retry."],"exampleFix":null,"handlingStrategy":"try-catch","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"}