Project

General

Profile

Actions

Bug #46452

closed

mgr/volumes: Python stack trace instead of a graceful error is thrown when executing ceph fs subvolume <command> <non-existent-vol-name> <...>

Added by Shyamsundar Ranganathan almost 4 years ago. Updated almost 4 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Administration/Usability
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
4 - irritation
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
mgr/volumes
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The following python stack trace is thrown whenever an non-existent vol-name is used in any subvolume command:

(cephfs volume does not exist in the test below)
ceph fs subvolume ls cephfs
Error EINVAL: Traceback (most recent call last):
File "...ceph/src/pybind/mgr/mgr_module.py", line 1170, in _handle_command
return self.handle_command(inbuf, cmd)
File "...ceph/src/pybind/mgr/volumes/module.py", line 355, in handle_command
return handler(inbuf, cmd)
File "...ceph/src/pybind/mgr/volumes/module.py", line 415, in _cmd_fs_subvolume_ls
group_name=cmd.get('group_name', None))
File "...ceph/src/pybind/mgr/volumes/fs/volume.py", line 284, in list_subvolumes
with open_volume(self, volname) as fs_handle:
File "/usr/lib64/python3.7/contextlib.py", line 112, in enter
return next(self.gen)
File "...ceph/src/pybind/mgr/volumes/fs/operations/volume.py", line 138, in open_volume
with open_filesystem(vc, volname) as fs_handle:
File "/usr/lib64/python3.7/contextlib.py", line 112, in enter
return next(self.gen)
File "...ceph/src/pybind/mgr/mgr_util.py", line 260, in open_filesystem
fs_handle = fsc.connection_pool.get_fs_handle(fs_name)
File "...ceph/src/pybind/mgr/mgr_util.py", line 192, in get_fs_handle
conn = CephfsConnectionPool.Connection(self.mgr, fs_name)
File "...ceph/src/pybind/mgr/mgr_util.py", line 62, in init
self.fs_id = self.get_fs_id()
File "...ceph/src/pybind/mgr/mgr_util.py", line 70, in get_fs_id
-errno.ENOENT, "FS '{0}' not found".format(self.fs_name))
mgr_util.CephfsConnectionException: -2 (FS 'cephfs' not found)

The issue stems from open_volume returning any exception, and the subvolume series of commands only converting VolumeException errors, as seen here:
- https://github.com/ceph/ceph/blob/9599a39d3bdad01ef01db3347c55aaadcd13cb27/src/pybind/mgr/volumes/fs/operations/volume.py#L126-L139
- https://github.com/ceph/ceph/blob/9599a39d3bdad01ef01db3347c55aaadcd13cb27/src/pybind/mgr/volumes/fs/volume.py#L283-L289

Actions #1

Updated by Kotresh Hiremath Ravishankar almost 4 years ago

  • Status changed from New to Duplicate
Actions

Also available in: Atom PDF