BerriAI/litellm · error · HTTPException
No users found to update
Error message
No users found to update
What it means
Error "No users found to update" thrown in BerriAI/litellm.
Source
Thrown at litellm/proxy/management_endpoints/internal_user_endpoints.py:1764
status_code=403,
detail="Only proxy admins can modify user roles.",
)
# Determine the list of users to update
users_to_update: list[UpdateUserRequest] | list[UpdateUserRequestNoUserIDorEmail] = []
if data.all_users and data.user_updates:
# Only proxy admins can update all users at once
if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN.value:
raise HTTPException(
status_code=403,
detail="Only proxy admins can update all users at once.",
)
# Optimized path for updating all users directly in database
all_users_in_db: Final = await _user_table(prisma_client).find_many(order={"created_at": "desc"})
if not all_users_in_db:
raise HTTPException(
status_code=400,
detail={"error": "No users found to update"},
)
# Limit batch size to prevent overwhelming the system
MAX_BATCH_SIZE = 500 # Increased limit for all-users operations
if len(all_users_in_db) > MAX_BATCH_SIZE:
raise HTTPException(
status_code=400,
detail={
"error": f"Maximum {MAX_BATCH_SIZE} users can be updated at once. Found {len(all_users_in_db)} users."
},
)
# Apply update transformations (reuse existing logic)
data_json: Final[dict] = data.user_updates.model_dump(exclude_unset=True)
non_default_values: Final = _update_internal_user_params(data_json=data_json, data=data.user_updates)
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Verify the filter criteria match existing users; broaden the query or check user IDs with /user/list.
- Confirm you are connected to the correct database (DATABASE_URL) that actually contains the users.
When it happens
Trigger: Thrown at litellm/proxy/management_endpoints/internal_user_endpoints.py:1764 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/312aa92890e39bc0.
Report an issue: GitHub.