]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: Edit user via UI throwing multiple server errors
authorNaman Munet <naman.munet@ibm.com>
Fri, 24 Oct 2025 05:59:09 +0000 (11:29 +0530)
committerNaman Munet <naman.munet@ibm.com>
Fri, 24 Oct 2025 05:59:09 +0000 (11:29 +0530)
Fixes: https://tracker.ceph.com/issues/73637
Commit includes:
Returning the default user ratelimit when the ratelimit for user is not set, hence eliminating the 500 error on UI

Signed-off-by: Naman Munet <naman.munet@ibm.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts
src/pybind/mgr/dashboard/services/rgw_client.py

index a46a3c5cc3f00abe4b7366973b7c674f53d5c913..bd8dbdd8a1018b4c33f47f4f6795c7dc9fc2ae0d 100644 (file)
@@ -207,7 +207,6 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
       const observables = [];
       observables.push(this.rgwUserService.get(uid));
       observables.push(this.rgwUserService.getQuota(uid));
-      observables.push(this.rgwUserService.getUserRateLimit(uid));
       observableForkJoin(observables).subscribe(
         (resp: any[]) => {
           // Get the default values.
index 35fd913622264fd46fd82672571b1bff98c01f5f..3b62eb7b0d48474fd3f7987b075bdd539f81dc2b 100755 (executable)
@@ -47,6 +47,15 @@ logger = logging.getLogger('rgw_client')
 _SYNC_GROUP_ID = 'dashboard_admin_group'
 _SYNC_FLOW_ID = 'dashboard_admin_flow'
 _SYNC_PIPE_ID = 'dashboard_admin_pipe'
+DEFAULT_USER_RATELIMIT = {
+    "user_ratelimit": {
+        "max_read_ops": 0,
+        "max_write_ops": 0,
+        "max_read_bytes": 0,
+        "max_write_bytes": 0,
+        "enabled": False
+    }
+}
 
 
 class NoRgwDaemonsException(Exception):
@@ -1717,6 +1726,8 @@ class RgwRateLimit:
         try:
             exit_code, out, err = mgr.send_rgwadmin_command(rate_limit_cmd)
             if exit_code > 0:
+                if "No such file or directory" in str(err):
+                    return DEFAULT_USER_RATELIMIT
                 raise DashboardException(f'Unable to get rate limit: {err}',
                                          http_status_code=500, component='rgw')
             return out