Description of problem:[cephadm] 5.0 - Ceph orch apply command throws traceback message instead of helping users with closest match or help commands Version-Release number of selected component (if applicable): [root@magna106 ubuntu]# sudo cephadm version Using recent ceph image registry.redhat.io/rhceph-alpha/rhceph-5-rhel8:latest ceph version 16.0.0-7953.el8cp (aac7c5c7d5f82d2973c366730f65255afd66e515) pacific (dev) How reproducible: Steps to Reproduce: 1. Install 5.0 cluster 2. enter cephadm shell 3. perform "ceph orch apply" command and check the behaviour Actual results: Below traceback message seen instead of help options for users [ceph: root@magna094 /]# ceph orch apply Error EINVAL: Traceback (most recent call last): File "/usr/share/ceph/mgr/mgr_module.py", line 1195, in _handle_command return self.handle_command(inbuf, cmd) File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 141, in handle_command return dispatch[cmd['prefix']].call(self, cmd, inbuf) File "/usr/share/ceph/mgr/mgr_module.py", line 332, in call return self.func(mgr, **kwargs) File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 103, in <lambda> wrapper_copy = lambda *l_args, **l_kwargs: wrapper(*l_args, **l_kwargs) File "/usr/share/ceph/mgr/orchestrator/_interface.py", line 92, in wrapper return func(*args, **kwargs) File "/usr/share/ceph/mgr/orchestrator/module.py", line 1080, in _apply_misc assert service_type AssertionError Expected results: We need "ceph orch apply" option to display similar like below [ceph: root@magna094 /]# ceph orch no valid command found; 10 closest matches: orch host add <hostname> [<addr>] [<labels>...] orch host rm <hostname> orch host set-addr <hostname> <addr> orch host ls [plain|json|json-pretty|yaml] orch host label add <hostname> <label> orch host label rm <hostname> <label> orch host ok-to-stop <hostname> orch device ls [<hostname>...] [plain|json|json-pretty|yaml] [--refresh] [--wide] orch device zap <hostname> <path> [--force] orch ls [<service_type>] [<service_name>] [--export] [plain|json|json-pretty|yaml] [--refresh] Error EINVAL: invalid command [ceph: root@magna094 /]# Additional info:
Also an upstream bug related with this: https://tracker.ceph.com/issues/49056
Actually getting the closest matching commands to appear would be quite difficult as it would require "ceph orch apply" to actually not find a match. An error message like Error EINVAL: Improper use of 'ceph orch apply'. No valid service type provided. Usage: ceph orch apply -i <yaml spec> [--dry-run] ceph orch apply <service_type> [--placement=<placement_string>] [--unmanaged] where <service_type> can be: mon|mgr|rbd-mirror|crash|alertmanager|grafana|node-exporter|prometheus|mds|rgw|nfs|iscsi|cephadm-exporter that gives the context that no valid service type was provided to the apply command would be fairly straightforward. Would that be a sufficient fix?
@Adam, Yes. Something like that will help.
upstream change https://github.com/ceph/ceph/pull/39261
@Adam, Issue is fixed in latest alpha [ceph: root@ceph-sangadi-5-0-1614674044401-node1-mon-mgr-installer-node-exp /]# ceph orch apply Error EINVAL: Usage: ceph orch apply -i <yaml spec> [--dry-run] ceph orch apply <service_type> [--placement=<placement_string>] [--unmanaged] [ceph: root@ceph-sangadi-5-0-1614674044401-node1-mon-mgr-installer-node-exp /]#
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 (Red Hat Ceph Storage 5.0 bug fix and enhancement), 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/RHBA-2021:3294