Bug 2258581

Summary: [CephFS - SnapSchedule] Snap schedule list on invalid path generates error with Traceback
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: sumr
Component: CephFSAssignee: Milind Changire <mchangir>
Status: CLOSED DUPLICATE QA Contact: sumr
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1CC: amk, ceph-eng-bugs, cephqe-warriors, hyelloji, mchangir, ngangadh, vshankar
Target Milestone: ---   
Target Release: 7.1z1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-07-03 07:41:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sumr 2024-01-16 11:43:35 UTC
Description of problem:
Snap Schedule list on invalid path needs to provide command response as an error for invalid path, but it generates a Traceback as below,

[root@ceph-sumar-regression-5ohzjt-node6 ~]# ceph fs snap-schedule list /volumes/svg2/sv1 --fs cephfs
Error EINVAL: Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1794, in _handle_command
    return CLICommand.COMMANDS[cmd['prefix']].call(self, cmd, inbuf)
  File "/usr/share/ceph/mgr/mgr_module.py", line 462, in call
    return self.func(mgr, **kwargs)
  File "/usr/share/ceph/mgr/snap_schedule/module.py", line 154, in snap_schedule_list
    return -errno.ENOENT, '', f'SnapSchedule for {abs_path} not found'
NameError: name 'abs_path' is not defined

Here, the traceback info generates ambiguous message in "NameError: name 'abs_path' is not defined". The user level error message had to mention the path '/volumes/svg2/sv1' as invalid or something similar to 'Error ENOENT: No schedule found for /volumes/svg2/sv1'

Traceback info needs in command response needs to be avoided and simple error message relevant to non-existing path needs to be printed.

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


How reproducible: consistent