BerriAI/litellm · error · HTTPException

Team id = {team_id} does not exist. Error updating team logg

Error message

Team id = {team_id} does not exist. Error updating team logging

What it means

During the team update that persists disabled callback settings, the DB update reports the team no longer exists (concurrent deletion or bad id resurfacing at write time); the endpoint raises 404 'Error updating team logging' naming the team_id.

Source

Thrown at litellm/proxy/management_endpoints/team_callback_endpoints.py:453

        team_metadata["callback_settings"] = team_callback_settings_obj.model_dump()
        # _get_dynamic_logging_metadata stops at metadata["logging"], where the API
        # and Admin UI register callbacks, without ever reading callback_settings.
        team_metadata["logging"] = []  # mutable-ok: the disabled state is persisted as an empty JSON array
        team_metadata = encrypt_callback_vars(team_metadata)
        team_metadata_json: Final = json.dumps(team_metadata)

        # Update team in database
        updated_team: Final = await TeamRepository(prisma_client).table.update(
            where={"team_id": team_id},
            data={"metadata": team_metadata_json},
            # `object_permission` is included so `_refresh_cached_team` doesn't
            # write a cached team with the relation nulled out — see
            # team_model_add for the full rationale.
            include={"object_permission": True},  # mutable-ok: prisma include takes a dict literal
        )

        if updated_team is None:
            raise HTTPException(
                status_code=404,
                detail={"error": f"Team id = {team_id} does not exist. Error updating team logging"},
            )

        # Request-time callback resolution reads the cached team, so without this
        # the DB says logging is off while live keys keep sending until it expires.
        await _refresh_cached_team(
            team_row=updated_team,
            user_api_key_cache=user_api_key_cache,
            proxy_logging_obj=proxy_logging_obj,
        )

        # Disabling a team's logging callbacks is itself a logging-control
        # action — emit an audit-log row so the action remains traceable
        # even though the team's own observability is now off.
        await _emit_team_callback_audit_log(
            team_id=team_id,
            before_metadata=before_metadata,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use an existing team id; verify via /team/list before updating team logging.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/team_callback_endpoints.py:453 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/680ed9bf56baa748. Report an issue: GitHub.