Bug 2064889 - [CephFS] Unable to set Quota on the directories from Dashboard
Summary: [CephFS] Unable to set Quota on the directories from Dashboard
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Ceph-Dashboard
Version: 5.1
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: 6.0
Assignee: Ernesto Puerta
QA Contact: Amarnath
Masauso Lungu
URL:
Whiteboard:
Depends On:
Blocks: 2126050
TreeView+ depends on / blocked
 
Reported: 2022-03-16 19:35 UTC by Amarnath
Modified: 2023-03-20 18:56 UTC (History)
9 users (show)

Fixed In Version: ceph-17.2.3-1.el9cp
Doc Type: Enhancement
Doc Text:
.Ceph Dashboard now clearly indicates that errors on certain CephFS operations Previously, when a user tried to perform an operation on a filesystem directory, but did not have permission, the Ceph Dashboard reported a generic 500 internal server-side error. However, these errors are actually imputable to users, since permissions are the same for preventing certain actions for given users. With this release, when the user tries to perform an unauthorized operation, they receive a clear explanation on the permission error.
Clone Of:
Environment:
Last Closed: 2023-03-20 18:56:12 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 48686 0 None None None 2022-03-23 10:25:53 UTC
Ceph Project Bug Tracker 51611 0 None None None 2022-03-23 10:25:53 UTC
Github ceph ceph pull 44849 0 None Merged mgr/dashboard: Directories Menu Can't Use on Ceph File System Dashboard 2022-03-23 10:25:53 UTC
Red Hat Issue Tracker RHCEPH-3802 0 None None None 2022-03-16 19:43:36 UTC
Red Hat Issue Tracker RHCSDASH-698 0 None None None 2022-03-16 19:43:38 UTC
Red Hat Product Errata RHBA-2023:1360 0 None None None 2023-03-20 18:56:36 UTC

Description Amarnath 2022-03-16 19:35:48 UTC
Description of problem:
We are not able to set the quota on the directories in FileSystem(FS)

We are seeing 500 Internal error warning

Same we are able to set using CLI
[root@ceph-snap-fail-amk-01m9k1-node7 ka0u5sud4y]# setfattr -n ceph.quota.max_files -v 1000 /mnt/cephfs_kernelta8rz2hnwt/ka0u5sud4y
[root@ceph-snap-fail-amk-01m9k1-node7 ka0u5sud4y]# getfattr --only-values -n ceph.quota.max_files /mnt/cephfs_kernelta8rz2hnwt/ka0u5sud4y
getfattr: Removing leading '/' from absolute path names
1000[root@ceph-snap-fail-amk-01m9k1-node7 ka0u5sud4y]# 


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 RHEL Program Management 2022-03-16 19:35:53 UTC
Please specify the severity of this bug. Severity is defined here:
https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity.

Comment 4 Amarnath 2022-03-23 09:49:17 UTC
Hi Ernesto,

After enabling the debug mode also I did not see much info on the Dashboard page.
As you suspected it is a permission issue.
Please find the trace from mgr logs.

debug 2022-03-23T09:37:25.958+0000 7f08e5685700  0 [dashboard ERROR exception] Internal Server Error
Traceback (most recent call last):
  File "/usr/share/ceph/mgr/dashboard/services/exception.py", line 46, in dashboard_exception_handler
    return handler(*args, **kwargs)
  File "/lib/python3.6/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/share/ceph/mgr/dashboard/controllers/_base_controller.py", line 258, in inner
    ret = func(*args, **kwargs)
  File "/usr/share/ceph/mgr/dashboard/controllers/_rest_controller.py", line 191, in wrapper
    return func(*vpath, **params)
  File "/usr/share/ceph/mgr/dashboard/controllers/cephfs.py", line 434, in quota
    return cfs.set_quotas(path, max_bytes, max_files)
  File "/usr/share/ceph/mgr/dashboard/services/cephfs.py", line 263, in set_quotas
    str(max_files).encode(), 0)
  File "cephfs.pyx", line 1691, in cephfs.LibCephFS.setxattr
cephfs.OSError: error in setxattr: Permission denied [Errno 13]
debug 2022-03-23T09:37:25.959+0000 7f08e5685700  0 [dashboard ERROR request] [::ffff:10.67.24.10:59786] [PUT] [500] [0.034s] [admin] [1.8K] /api/cephfs/1/quota
debug 2022-03-23T09:37:25.959+0000 7f08e5685700  0 [dashboard ERROR request] [b'{"status": "500 Internal Server Error", "detail": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "request_id": "7cee5302-5102-4de7-a489-7e7e644bc7b3", "traceback": "Traceback (most recent call last):\\n  File \\"/lib/python3.6/site-packages/cherrypy/_cprequest.py\\", line 638, in respond\\n    self._do_respond(path_info)\\n  File \\"/lib/python3.6/site-packages/cherrypy/_cprequest.py\\", line 697, in _do_respond\\n    response.body = self.handler()\\n  File \\"/lib/python3.6/site-packages/cherrypy/lib/encoding.py\\", line 219, in __call__\\n    self.body = self.oldhandler(*args, **kwargs)\\n  File \\"/lib/python3.6/site-packages/cherrypy/_cptools.py\\", line 230, in wrap\\n    return self.newhandler(innerfunc, *args, **kwargs)\\n  File \\"/usr/share/ceph/mgr/dashboard/services/exception.py\\", line 55, in dashboard_exception_handler\\n    raise error\\n  File \\"/usr/share/ceph/mgr/dashboard/services/exception.py\\", line 46, in dashboard_exception_handler\\n    return handler(*args, **kwargs)\\n  File \\"/lib/python3.6/site-packages/cherrypy/_cpdispatch.py\\", line 54, in __call__\\n    return self.callable(*self.args, **self.kwargs)\\n  File \\"/usr/share/ceph/mgr/dashboard/controllers/_base_controller.py\\", line 258, in inner\\n    ret = func(*args, **kwargs)\\n  File \\"/usr/share/ceph/mgr/dashboard/controllers/_rest_controller.py\\", line 191, in wrapper\\n    return func(*vpath, **params)\\n  File \\"/usr/share/ceph/mgr/dashboard/controllers/cephfs.py\\", line 434, in quota\\n    return cfs.set_quotas(path, max_bytes, max_files)\\n  File \\"/usr/share/ceph/mgr/dashboard/services/cephfs.py\\", line 263, in set_quotas\\n    str(max_files).encode(), 0)\\n  File \\"cephfs.pyx\\", line 1691, in cephfs.LibCephFS.setxattr\\ncephfs.OSError: error in setxattr: Permission denied [Errno 13]\\n", "version": "18.4.0"}']

Mount command used to mount the ceph directory:
mount -t ceph 10.0.208.235,10.0.211.239,10.0.211.126:/ /mnt/cephfs_kernel4ojdhz1yii/ -o name=ceph-snap-fail-amk-w25dhr-node7,secretfile=/etc/ceph/ceph-snap-fail-amk-w25dhr-node7.secret

How can I perform with the above user?
or 
Can we have a proper error that gives the details that the mount has been done by a different user?


Regards,
Amarnath

Comment 6 Amarnath 2022-03-25 11:44:53 UTC
Hi Ernesto,

Thanks for the trackers.

As we already have a tracker Shall I close this bug as a Duplicate?

Regards,
Amarnath

Comment 8 Amarnath 2022-03-29 05:25:05 UTC
Sure, Ernesto.

Comment 16 Amarnath 2022-10-03 06:38:17 UTC
Verified it on Below Version and it all looks fine.
We are not seeing 500 internal error

100[root@ceph-amk-up-zgzb90-node7 cephfs_fuse]# getfattr --only-values -n ceph.quota.max_files /mnt/cephfs_fusetojakmgg11/189uibdc92/
getfattr: Removing leading '/' from absolute path names
999[root@ceph-amk-up-zgzb90-node7 cephfs_fuse]# ceph versions
{
    "mon": {
        "ceph version 17.2.3-42.el9cp (1d92a7a016e5b5e517e4b53a8be4def327a0b9ad) quincy (stable)": 3
    },
    "mgr": {
        "ceph version 17.2.3-42.el9cp (1d92a7a016e5b5e517e4b53a8be4def327a0b9ad) quincy (stable)": 2
    },
    "osd": {
        "ceph version 17.2.3-42.el9cp (1d92a7a016e5b5e517e4b53a8be4def327a0b9ad) quincy (stable)": 12
    },
    "mds": {
        "ceph version 17.2.3-42.el9cp (1d92a7a016e5b5e517e4b53a8be4def327a0b9ad) quincy (stable)": 3
    },
    "overall": {
        "ceph version 17.2.3-42.el9cp (1d92a7a016e5b5e517e4b53a8be4def327a0b9ad) quincy (stable)": 20
    }
}

Regards
Amarnath

Comment 36 errata-xmlrpc 2023-03-20 18:56:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat Ceph Storage 6.0 Bug Fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:1360


Note You need to log in before you can comment on or make changes to this bug.