BerriAI/litellm · error · HTTPException

User with ID '{partition.unknown_ids[0]}' does not exist. Pl

Error message

User with ID '{partition.unknown_ids[0]}' does not exist. Please create the user first via POST /Users before adding to group.

What it means

After classifying group members, any member id that is neither an existing user, an existing team, nor a declared non-user blocks the whole group PATCH (when scim_upsert_user is false): the code raises 400 naming the first unknown id and instructing the client to create the user via POST /Users first.

Source

Thrown at litellm/proxy/management_endpoints/scim/scim_v2.py:652

    user to drop.

    Raises:
        HTTPException: 400 when a member id is empty, or when scim_upsert_user is
        False and a member id is neither an existing user, an existing team, nor a
        member declared to be something other than a user.
    """
    classified: Final = tuple([await _classify_group_member(member, prisma_client) for member in members])
    partition: Final = _partition_classified_members(classified)

    for skipped in partition.skipped:
        verbose_proxy_logger.info(
            "SCIM: ignoring non-user group member '%s' (%s); LiteLLM teams contain users only",
            skipped.value,
            skipped.reason,
        )

    if partition.unknown_ids and not await _get_scim_upsert_user_setting():
        raise HTTPException(
            status_code=400,
            detail={
                "error": f"User with ID '{partition.unknown_ids[0]}' does not exist. "
                "Please create the user first via POST /Users before adding to group."
            },
        )

    creations: Final = tuple(
        [
            (user_id, await _create_user_if_not_exists(user_id=user_id, created_via=created_via))
            for user_id in partition.unknown_ids
        ]
    )
    created_users: Final = tuple(created for _, created in creations if created is not None)

    return GroupMemberExtractionResult(
        existing_member_ids=partition.resolved_ids,
        created_users=created_users,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Create the user first via POST /Users before adding to the group.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/scim/scim_v2.py:652 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/968eafe9ae59d59f. Report an issue: GitHub.