From: Naman Munet Date: Fri, 24 Oct 2025 05:59:09 +0000 (+0530) Subject: mgr/dashboard: Edit user via UI throwing multiple server errors X-Git-Tag: testing/wip-vshankar-testing-20251102.170524-debug~19^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b72071af0beb30ff022bdfa9b9f970309438632a;p=ceph-ci.git mgr/dashboard: Edit user via UI throwing multiple server errors 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 --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts index a46a3c5cc3f..bd8dbdd8a10 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts @@ -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. diff --git a/src/pybind/mgr/dashboard/services/rgw_client.py b/src/pybind/mgr/dashboard/services/rgw_client.py index 35fd9136222..3b62eb7b0d4 100755 --- a/src/pybind/mgr/dashboard/services/rgw_client.py +++ b/src/pybind/mgr/dashboard/services/rgw_client.py @@ -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