Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(proxy): log audit log failures in /user/bulk_delete instead of dropping them

ryanbeaa96fc8f84
diff --git a/litellm/proxy/management_helpers/bulk_user_deletion.py b/litellm/proxy/management_helpers/bulk_user_deletion.py
index a2d3348a30e..f2ac8259fa5 100644
--- a/litellm/proxy/management_helpers/bulk_user_deletion.py
+++ b/litellm/proxy/management_helpers/bulk_user_deletion.py
@@ -301,7 +301,7 @@ async def _delete_user_rows(
litellm_changed_by: str | None,
) -> None:
user_ids: Final = frozenset(u.user_id for u in users)
- await _bounded(
+ audit_outcomes: Final = await _bounded(
UserManagementEventHooks.create_internal_user_audit_log(
user_id=u.user_id,
action="deleted",
@@ -312,6 +312,9 @@ async def _delete_user_rows(
)
for u in users
)
+ for u, outcome in zip(users, audit_outcomes, strict=True):
+ if isinstance(outcome, BaseException):
+ verbose_proxy_logger.warning("Failed to create audit log for user %s: %s", u.user_id, outcome)
keys: Final = await VerificationTokenRepository(prisma_client).table.find_many(
where=_in_filter("user_id", user_ids)
)