]> git-server-git.apps.pok.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 <nmunet@redhat.com>
Wed, 29 Oct 2025 08:18:40 +0000 (08:18 +0000)
Fixes: https://tracker.ceph.com/issues/73637
Resolves: rhbz#2403703

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>
(cherry picked from commit b72071af0beb30ff022bdfa9b9f970309438632a)
(cherry picked from commit 4755f742247b51f28b1a0be56f30d9f443021b3e)

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 69126321c05b1d155e9d65bb49c1546bae84cfc2..d8b7ae81e4cb79619b2df6e9925143cc55298af9 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