Project

General

Profile

Actions

Bug #69865

open

mgr/vol: print errmsg and hide tracebacks when subvol metadata file name is too long

Added by Rishabh Dave about 1 year ago. Updated 5 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Backport:
squid,reef
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
mgr/volumes
Labels (FS):
Pull request ID:
Tags (freeform):
backport_processed
Fixed In:
v19.3.0-8025-g53e3ed2907
Released In:
v20.2.0~981
Upkeep Timestamp:
2025-11-01T01:00:38+00:00

Description

When ceph fs subvolume create command is run such that subvol metadata file name becomes longer than 255 character, a bunch of stacktraces are printed with multiple error which not only looks bad but also confuses the users. In such case, a good, brief error message should be printed for this command along with an appropriate error number that allows users to understand the issue and/or create proper tickets for devs.

Remember, to reproduce this bug the subvol metadata file name should exceed 255 characters. Subvol metadata file name is composed of subvol group name, subvol name, ".meta", "_" and ":". Therefore, subvol group name alone or subvol name alone being longer than 255 characters can't reproduce this bug.

In example below, the combination subvol group name and subvol name crosses 255 characters -

ceph fs subvolumegroup create svg
ceph fs subvolume create a sv1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 --group-name svg
*** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
2025-02-07T17:27:12.206+0530 7f9e2aa006c0 -1 WARNING: all dangerous and experimental features are enabled.
2025-02-07T17:27:12.218+0530 7f9e2aa006c0 -1 WARNING: all dangerous and experimental features are enabled.
Error EINVAL: Traceback (most recent call last):
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py", line 356, in discover
    self.fs.stat(self.base_path)
  File "cephfs.pyx", line 1978, in cephfs.LibCephFS.stat
cephfs.ObjectNotFound: error in stat: /volumes/svg/sv1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111: No such file or directory [Errno 2]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/squid/src/pybind/mgr/volumes/fs/volume.py", line 258, in create_subvolume
    with open_subvol(self.mgr, fs_handle, self.volspec, group, subvolname, SubvolumeOpType.CREATE) as subvolume:
  File "/usr/lib64/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/subvolume.py", line 73, in open_subvol 
    subvolume = loaded_subvolumes.get_subvolume_object(mgr, fs, vol_spec, group, subvolname)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/__init__.py", line 111, in get_subvolume_object
    subvolume.discover()
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/subvolume_base.py", line 376, in discover
    raise (VolumeException(-errno.ENOENT,
volumes.fs.exception.VolumeException: -2 (subvolume 'sv1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' does not exist)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py", line 192, in create
    self.auth_mdata_mgr.create_subvolume_metadata_file(self.group.groupname, self.subvolname)
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/auth_metadata.py", line 155, in create_subvolume_metadata_file
    fd = self.fs.open(self._subvolume_metadata_path(group_name, subvol_name),
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cephfs.pyx", line 1416, in cephfs.LibCephFS.open
cephfs.OSError: error in open /volumes/_svg:sv1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.meta: File name too long [Errno 36]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/squid/src/pybind/mgr/mgr_module.py", line 1890, in _handle_command 
    return self.handle_command(inbuf, cmd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/squid/src/pybind/mgr/volumes/module.py", line 601, in handle_command
    return handler(inbuf, cmd)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/squid/src/pybind/mgr/volumes/module.py", line 38, in wrap
    return f(self, inbuf, cmd)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/squid/src/pybind/mgr/volumes/module.py", line 674, in _cmd_fs_subvolume_create
    return self.vc.create_subvolume(vol_name=cmd['vol_name'],
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/squid/src/pybind/mgr/volumes/fs/volume.py", line 272, in create_subvolume
    self._create_subvolume(fs_handle, volname, group, subvolname, **kwargs)
  File "/home/squid/src/pybind/mgr/volumes/fs/volume.py", line 233, in _create_subvolume
    create_subvol(
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/subvolume.py", line 24, in create_subvol
    subvolume.create(size, isolate_nspace, pool, mode, uid, gid, earmark)
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py", line 195, in create
    self._remove_on_failure(subvol_path, retained)
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py", line 150, in _remove_on_failure 
    self.remove(internal_cleanup=True)
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/subvolume_v2.py", line 375, in remove
    self.auth_mdata_mgr.delete_subvolume_metadata_file(self.group.groupname, self.subvolname)
  File "/home/squid/src/pybind/mgr/volumes/fs/operations/versions/auth_metadata.py", line 162, in delete_subvolume_metadata_file
    self.fs.unlink(vol_meta_path)
  File "cephfs.pyx", line 2258, in cephfs.LibCephFS.unlink
cephfs.OSError: error in unlink: /volumes/_svg:sv1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.meta: File name too long [Errno 36]

The issue is reproducible on main, squid and reef, upstream as well as downstream.


Related issues 2 (1 open1 closed)

Copied to CephFS - Backport #70230: squid: mgr/vol: print errmsg and hide tracebacks when subvol metadata file name is too longFix Under ReviewRishabh DaveActions
Copied to CephFS - Backport #70231: reef: mgr/vol: print errmsg and hide tracebacks when subvol metadata file name is too longResolvedRishabh DaveActions
Actions #1

Updated by Rishabh Dave about 1 year ago ยท Edited

@Venky Shankar In interest of corresponding downstream version should this BZ be backported to Quincy as well, despite Quincy being beyond EOL date?

Actions #2

Updated by Rishabh Dave about 1 year ago

  • Pull request ID set to 61706
Actions #3

Updated by Rishabh Dave about 1 year ago

  • Status changed from In Progress to Fix Under Review
Actions #4

Updated by Rishabh Dave about 1 year ago

  • Status changed from Fix Under Review to Pending Backport
Actions #5

Updated by Upkeep Bot about 1 year ago

  • Copied to Backport #70230: squid: mgr/vol: print errmsg and hide tracebacks when subvol metadata file name is too long added
Actions #6

Updated by Upkeep Bot about 1 year ago

  • Copied to Backport #70231: reef: mgr/vol: print errmsg and hide tracebacks when subvol metadata file name is too long added
Actions #7

Updated by Upkeep Bot about 1 year ago

  • Tags (freeform) set to backport_processed
Actions #8

Updated by Upkeep Bot 9 months ago

  • Merge Commit set to 53e3ed2907c8d2e5cae1ae09146a7ca16fc60d18
  • Fixed In set to v19.3.0-8025-g53e3ed2907c
  • Upkeep Timestamp set to 2025-07-08T18:07:35+00:00
Actions #9

Updated by Upkeep Bot 8 months ago

  • Fixed In changed from v19.3.0-8025-g53e3ed2907c to v19.3.0-8025-g53e3ed2907c8
  • Upkeep Timestamp changed from 2025-07-08T18:07:35+00:00 to 2025-07-14T15:22:04+00:00
Actions #10

Updated by Upkeep Bot 8 months ago

  • Fixed In changed from v19.3.0-8025-g53e3ed2907c8 to v19.3.0-8025-g53e3ed2907
  • Upkeep Timestamp changed from 2025-07-14T15:22:04+00:00 to 2025-07-14T20:46:32+00:00
Actions #11

Updated by Upkeep Bot 5 months ago

  • Released In set to v20.2.0~981
  • Upkeep Timestamp changed from 2025-07-14T20:46:32+00:00 to 2025-11-01T01:00:38+00:00
Actions

Also available in: Atom PDF