BerriAI/litellm · error · HTTPException

Team metadata failed validation.

Error message

Team metadata failed validation.

What it means

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.

Source

Thrown at litellm/proxy/management_helpers/team_metadata_validation.py:138

    ):
        raise HTTPException(
            status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
            detail={  # mutable-ok: HTTPException.detail has no immutable form
                "error": "custom_team_metadata_validate must be an async function"
            },
        )

    try:
        raw_result: Final = await asyncio.wait_for(validator(payload), timeout=timeout_seconds)
        result: Final = TeamMetadataValidationResult.model_validate(raw_result)
    except Exception:  # noqa: BLE001  # fail closed: any validator failure must block the team write
        raise HTTPException(
            status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
            detail={"error": unavailable_message},  # mutable-ok: HTTPException.detail has no immutable form
        )

    if not result.valid:
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={  # mutable-ok: HTTPException.detail has no immutable form
                "error": result.error_message or DEFAULT_TEAM_METADATA_VALIDATION_REJECTED_MESSAGE
            },
        )


def _read_timeout_seconds(general_settings: Mapping[str, object]) -> float:
    raw_timeout: Final = general_settings.get("team_metadata_validation_timeout")
    if isinstance(raw_timeout, (int, float)) and not isinstance(raw_timeout, bool) and raw_timeout > 0:
        return float(raw_timeout)
    return DEFAULT_TEAM_METADATA_VALIDATION_TIMEOUT_SECONDS


def _read_unavailable_message(general_settings: Mapping[str, object]) -> str:
    raw_message: Final = general_settings.get("team_metadata_validation_error_message")
    if isinstance(raw_message, str) and raw_message.strip():
        return raw_message

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Fix the team metadata to satisfy the configured validation schema/callback, then retry.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at litellm/proxy/management_helpers/team_metadata_validation.py:138 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/176a3fae62264bb8. Report an issue: GitHub.