{"record":{"id":"680ed9bf56baa748","repo":"BerriAI/litellm","slug":"team-id-team-id-does-not-exist-error-updating","errorCode":null,"errorMessage":"Team id = {team_id} does not exist. Error updating team logging","messagePattern":"Team id = (.+?) does not exist\\. Error updating team logging","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"litellm/proxy/management_endpoints/team_callback_endpoints.py","lineNumber":453,"sourceCode":"        team_metadata[\"callback_settings\"] = team_callback_settings_obj.model_dump()\n        # _get_dynamic_logging_metadata stops at metadata[\"logging\"], where the API\n        # and Admin UI register callbacks, without ever reading callback_settings.\n        team_metadata[\"logging\"] = []  # mutable-ok: the disabled state is persisted as an empty JSON array\n        team_metadata = encrypt_callback_vars(team_metadata)\n        team_metadata_json: Final = json.dumps(team_metadata)\n\n        # Update team in database\n        updated_team: Final = await TeamRepository(prisma_client).table.update(\n            where={\"team_id\": team_id},\n            data={\"metadata\": team_metadata_json},\n            # `object_permission` is included so `_refresh_cached_team` doesn't\n            # write a cached team with the relation nulled out — see\n            # team_model_add for the full rationale.\n            include={\"object_permission\": True},  # mutable-ok: prisma include takes a dict literal\n        )\n\n        if updated_team is None:\n            raise HTTPException(\n                status_code=404,\n                detail={\"error\": f\"Team id = {team_id} does not exist. Error updating team logging\"},\n            )\n\n        # Request-time callback resolution reads the cached team, so without this\n        # the DB says logging is off while live keys keep sending until it expires.\n        await _refresh_cached_team(\n            team_row=updated_team,\n            user_api_key_cache=user_api_key_cache,\n            proxy_logging_obj=proxy_logging_obj,\n        )\n\n        # Disabling a team's logging callbacks is itself a logging-control\n        # action — emit an audit-log row so the action remains traceable\n        # even though the team's own observability is now off.\n        await _emit_team_callback_audit_log(\n            team_id=team_id,\n            before_metadata=before_metadata,","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/team_callback_endpoints.py#L435-L471","documentation":"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.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/team_callback_endpoints.py:453 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an existing team id; verify via /team/list before updating team logging."],"exampleFix":null,"handlingStrategy":"validation","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"}