{"record":{"id":"312aa92890e39bc0","repo":"BerriAI/litellm","slug":"no-users-found-to-update","errorCode":null,"errorMessage":"No users found to update","messagePattern":"No users found to update","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/internal_user_endpoints.py","lineNumber":1764,"sourceCode":"            status_code=403,\n            detail=\"Only proxy admins can modify user roles.\",\n        )\n\n    # Determine the list of users to update\n    users_to_update: list[UpdateUserRequest] | list[UpdateUserRequestNoUserIDorEmail] = []\n\n    if data.all_users and data.user_updates:\n        # Only proxy admins can update all users at once\n        if user_api_key_dict.user_role != LitellmUserRoles.PROXY_ADMIN.value:\n            raise HTTPException(\n                status_code=403,\n                detail=\"Only proxy admins can update all users at once.\",\n            )\n        # Optimized path for updating all users directly in database\n        all_users_in_db: Final = await _user_table(prisma_client).find_many(order={\"created_at\": \"desc\"})\n\n        if not all_users_in_db:\n            raise HTTPException(\n                status_code=400,\n                detail={\"error\": \"No users found to update\"},\n            )\n\n        # Limit batch size to prevent overwhelming the system\n        MAX_BATCH_SIZE = 500  # Increased limit for all-users operations\n        if len(all_users_in_db) > MAX_BATCH_SIZE:\n            raise HTTPException(\n                status_code=400,\n                detail={\n                    \"error\": f\"Maximum {MAX_BATCH_SIZE} users can be updated at once. Found {len(all_users_in_db)} users.\"\n                },\n            )\n\n        # Apply update transformations (reuse existing logic)\n        data_json: Final[dict] = data.user_updates.model_dump(exclude_unset=True)\n        non_default_values: Final = _update_internal_user_params(data_json=data_json, data=data.user_updates)\n","sourceCodeStart":1746,"sourceCodeEnd":1782,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/internal_user_endpoints.py#L1746-L1782","documentation":"Error \"No users found to update\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/internal_user_endpoints.py:1764 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":null,"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"}