Bug 2006214 - [cephadm] : traceback is dumped when unexpected input is provided for `format` argument
Summary: [cephadm] : traceback is dumped when unexpected input is provided for `format...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Cephadm
Version: 5.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 5.2
Assignee: Redouane Kachach Elhichou
QA Contact: Manasa
Karen Norteman
URL:
Whiteboard:
Depends On:
Blocks: 2102272
TreeView+ depends on / blocked
 
Reported: 2021-09-21 08:08 UTC by Vasishta
Modified: 2022-08-09 17:36 UTC (History)
6 users (show)

Fixed In Version: ceph-16.2.8-2.el8cp
Doc Type: Bug Fix
Doc Text:
.Users providing `--format` argument with unsupported formats received a traceback Previously, the orchestrator would throw an exception whenever it received a `--format` argument that it did not support, causing users who passed `--format` with unsupported formats to receive a traceback. With this fix, unsupported formats are now properly handled and users providing an unsupported format get a message explaining that the format is unsupported.
Clone Of:
Environment:
Last Closed: 2022-08-09 17:36:05 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ceph ceph pull 45023 0 None Merged mgr/cephadm: Show an error when invalid format 2022-05-26 04:21:16 UTC
Red Hat Issue Tracker RHCEPH-1836 0 None None None 2021-09-21 08:13:09 UTC
Red Hat Product Errata RHSA-2022:5997 0 None None None 2022-08-09 17:36:30 UTC

Description Vasishta 2021-09-21 08:08:03 UTC
Description of problem:
`traceback` is dumped when unexpected input is provided for `format` argument 
(Tried xml)

Version-Release number of selected component (if applicable):
16.2.0-117.el8cp

How reproducible:
Always

Steps to Reproduce:
1. try ceph orch status --detail --format xml

Actual results:
# ceph orch status --detail --format xml 
Error EINVAL: Traceback (most recent call last):
  File "/usr/share/ceph/mgr/mgr_module.py", line 1345, in _handle_command
    return self.handle_command(inbuf, cmd)
  File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 167, in handle_command
    return dispatch[cmd['prefix']].call(self, cmd, inbuf)
  File "/usr/share/ceph/mgr/mgr_module.py", line 386, in call
    kwargs = self._collect_args_by_argspec(cmd_dict)
  File "/usr/share/ceph/mgr/mgr_module.py", line 379, in _collect_args_by_argspec
    kwargs[k] = CephArgtype.cast_to(tp, v)
  File "/lib/python3.6/site-packages/ceph_argparse.py", line 243, in cast_to
    return tp(v)
  File "/lib64/python3.6/enum.py", line 293, in __call__
    return cls.__new__(cls, value)
  File "/lib64/python3.6/enum.py", line 535, in __new__
    return cls._missing_(value)
  File "/lib64/python3.6/enum.py", line 548, in _missing_
    raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 'xml' is not a valid Format

Expected results:
Tracebacks are not expected to be dumped to user for cli call

Additional info:

Comment 1 Sebastian Wagner 2021-09-21 08:24:27 UTC
this might be a real issue: could you verify if other commands that do in fact support xml still properly work? ceph health --format xml

Comment 5 Redouane Kachach Elhichou 2022-03-02 12:03:16 UTC
Issue fixed by the PR: 

https://github.com/ceph/ceph/pull/45023

In the new implementation an error is shown (option not implemented) instead of failing with a stacktrace.

Comment 10 Redouane Kachach Elhichou 2022-06-01 08:24:35 UTC
Thanks for testing the fix. AFAIK, right now there are no plans to support xml format for this option.

Comment 17 errata-xmlrpc 2022-08-09 17:36:05 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 (Moderate: Red Hat Ceph Storage Security, Bug Fix, and Enhancement 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/RHSA-2022:5997


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