Project

General

Profile

Bug #47372

mgr/dashboard: error when typing existing folder name in the NFS-Ganesha form

Added by Kiefer Chang 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
dashboard/nfs-ganesha
Target version:
% Done:

0%

Source:
Tags:
Backport:
octopus
Regression:
Yes
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

How to reproduce:

- Create a CephFS export for the path `/foo`. The folder will be created in the FS.
- Create another CephFS export and type `/foo` in the path field, an error message is displayed.

The error in the backend is:

2020-09-09T08:55:40.647+0000 7f2ffa257700  0 [dashboard ERROR exception] Internal Server Error
Traceback (most recent call last):
  File "/ceph/src/pybind/mgr/dashboard/services/exception.py", line 48, in dashboard_exception_handler
    return handler(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/ceph/src/pybind/mgr/dashboard/controllers/__init__.py", line 666, in inner
    ret = func(*args, **kwargs)
  File "/ceph/src/pybind/mgr/dashboard/controllers/nfsganesha.py", line 294, in lsdir
    paths = cfs.ls_dir(root_dir, depth)
  File "/ceph/src/pybind/mgr/dashboard/services/cephfs.py", line 78, in ls_dir
    return [self.get_directory(p) for p in paths if p != path.encode()]
  File "/ceph/src/pybind/mgr/dashboard/services/cephfs.py", line 78, in <listcomp>
    return [self.get_directory(p) for p in paths if p != path.encode()]
AttributeError: 'bytes' object has no attribute 'encode'

This also breaks the typeahead feature (auto-completing folder names when typing), the following feature displays right prompt.

cephfs_path_error.png View (55.7 KB) Kiefer Chang, 09/09/2020 08:52 AM

cephfs_path_typeahead.png View (40.3 KB) Kiefer Chang, 09/09/2020 08:52 AM


Related issues

Related to mgr - Feature #42617: mgr/dashboard: Add reload button for CephFS directories Resolved
Copied to mgr - Backport #47822: octopus: mgr/dashboard: error when typing existing folder name in the NFS-Ganesha form Resolved

History

#1 Updated by Kiefer Chang 4 months ago

  • Status changed from New to In Progress
  • Assignee set to Kiefer Chang

#2 Updated by Kiefer Chang 4 months ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 37064

#3 Updated by Kiefer Chang 4 months ago

The underlying API call `CephFS.ls_dir` was changed in https://github.com/ceph/ceph/pull/32552

#4 Updated by Lenz Grimmer 4 months ago

  • Related to Feature #42617: mgr/dashboard: Add reload button for CephFS directories added

#5 Updated by Lenz Grimmer 3 months ago

  • Status changed from Fix Under Review to Pending Backport
  • Target version set to v16.0.0

#6 Updated by Nathan Cutler 3 months ago

  • Copied to Backport #47822: octopus: mgr/dashboard: error when typing existing folder name in the NFS-Ganesha form added

#7 Updated by Lenz Grimmer 3 months ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF