BerriAI/litellm · error · HTTPException

Team(s) not found: {sorted(missing_ids)}

Error message

Team(s) not found: {sorted(missing_ids)}

What it means

Error "Team(s) not found: {sorted(missing_ids)}" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5644

                data={"team_member_permissions": merged_perms},
            )
        await batcher.commit()

    return len(updates)


async def _append_permissions_to_specific_teams(
    prisma_client: PrismaClient, team_ids: list[str], permissions_to_add: set
) -> int:
    """Fetch specific teams by ID and append permissions."""
    teams: Final = await _team_db(prisma_client).find_many(
        where={"team_id": {"in": team_ids}},
    )

    found_ids: Final = {team.team_id for team in teams}
    missing_ids: Final = set(team_ids) - found_ids
    if missing_ids:
        raise HTTPException(
            status_code=404,
            detail={"error": f"Team(s) not found: {sorted(missing_ids)}"},
        )

    return await _compute_and_batch_updates(prisma_client, teams, permissions_to_add)


async def _append_permissions_to_all_teams(prisma_client: PrismaClient, permissions_to_add: set) -> int:
    """Paginated read + batched write across all teams."""
    teams_updated = 0
    cursor = None
    BATCH_SIZE: Final = 500

    while True:
        find_args: _TeamFindManyArgs = {
            "take": BATCH_SIZE,
            "order": {"team_id": "asc"},
        }

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Verify each team id in team_ids exists via /team/list; remove the missing ids listed in the error.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_endpoints.py:5644 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/00e2623c72f8462e. Report an issue: GitHub.