Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1193710 - ceph tell: broken error message / wrong hinting
ceph tell: broken error message / wrong hinting
Status: CLOSED ERRATA
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: RADOS (Show other bugs)
1.2.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: 1.3.3
Assigned To: David Zafman
Vasishta
Bara Ancincova
: Patch
Depends On: 1335269
Blocks: 1372735
  Show dependency treegraph
 
Reported: 2015-02-17 17:55 EST by Federico Lucifredi
Modified: 2017-07-30 11:13 EDT (History)
6 users (show)

See Also:
Fixed In Version: RHEL: ceph-0.94.7-5.el7cp Ubuntu: ceph_0.94.7-3redhat1trusty
Doc Type: Bug Fix
Doc Text:
.The `ceph osd tell` command now prints correct error message When the deprecated `ceph osd tell` command was executed, the command returned a misleading error message. With this update, the error message is correct.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-29 08:54:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Ceph Project Bug Tracker 11101 None None None Never
Red Hat Product Errata RHSA-2016:1972 normal SHIPPED_LIVE Moderate: Red Hat Ceph Storage 1.3.3 security, bug fix, and enhancement update 2016-09-29 12:51:21 EDT

  None (edit)
Description Federico Lucifredi 2015-02-17 17:55:07 EST
Description of problem:

root@master:~# ceph osd tell
"osd tell" is deprecated; try "tell osd.<id>" instead (id can be "*") 
root@master:~# ceph tell osd.*
Cannot use 'tell' with interactive mode
root@master:~# 

Expected results: 

I am not in interactive mode!
Comment 1 John Poelstra 2015-02-19 14:03:38 EST
probably need a bug upstream
Comment 2 Federico Lucifredi 2015-03-11 15:58:25 EDT
just for context: Ceph odd tell is one of the "top ten" commands to try in Ceph Wiki, in Red Hat blogs, etc. That's where the path starts, then you hit the first error message, then you try to follow the hint... and then you fail again.
Comment 3 Federico Lucifredi 2015-03-11 15:59:29 EDT
posted upstream at tracker.cep.com (interestingly numbered issue 11101): http://tracker.ceph.com/issues/11101
Comment 4 Ken Dreyer (Red Hat) 2015-04-23 11:43:59 EDT
Looks like this is still unresolved upstream. Re-targeting to 2.0 in the meantime; please feel free to re-target if necessary
Comment 5 Federico Lucifredi 2015-07-11 00:57:16 EDT
this is just an error message correction. let's fix it instead of dragging the bug on for multiple releases :)
Comment 6 Ken Dreyer (Red Hat) 2015-07-14 21:13:11 EDT
Kefu, do you mind taking this one, or re-assigning as appropriate?
Comment 7 Kefu Chai 2015-07-15 07:10:40 EDT
pending on review: https://github.com/ceph/ceph/pull/5249
Comment 8 Ken Dreyer (Red Hat) 2015-07-15 11:44:21 EDT
Thanks Kefu!
Comment 9 Ken Dreyer (Red Hat) 2015-07-30 16:14:36 EDT
Patches to cherry-pick downstream: https://github.com/ceph/ceph/pull/5371/commits
Comment 12 Harish NV Rao 2015-10-20 07:00:01 EDT
Tested the fix and observed following:

--------------------------------------------------------
"ceph osd tell" now prints proper message. Following the contents of the message leads to successful execution of the commands

[cephuser@admin ~]$ sudo ceph osd tell
"osd tell" is deprecated; try "tell osd.<id> <command> [options...]" instead (id can be "*") 


[cephuser@admin ~]$ sudo ceph tell osd.4 bench 1024 4096
{
    "bytes_written": 1024,
    "blocksize": 4096,
    "bytes_per_sec": 52807.000000
}

--------------------------------------------------------
[cephuser@admin ~]$ sudo ceph tell
Cannot use 'tell' with interactive mode. For an interactive shell, please start "/bin/ceph" without non-option arguments.

Shouldn't the above error message be "Cannot use 'tell' with non-interactive mode. For an interactive shell, please start "/bin/ceph" without non-option arguments."? /bin/ceph actually opens interactive shell whereas just 'ceph <options/commands>' leads to non-interactive mode. Please correct me if I am wrong.
Comment 13 Ken Dreyer (Red Hat) 2015-10-20 13:19:48 EDT
(In reply to Harish NV Rao from comment #12)
> [cephuser@admin ~]$ sudo ceph tell
> Cannot use 'tell' with interactive mode. For an interactive shell, please
> start "/bin/ceph" without non-option arguments.
> 
> Shouldn't the above error message be "Cannot use 'tell' with non-interactive
> mode. For an interactive shell, please start "/bin/ceph" without non-option
> arguments."? /bin/ceph actually opens interactive shell whereas just 'ceph
> <options/commands>' leads to non-interactive mode. Please correct me if I am
> wrong.

Maybe we should alter the error text further to make this clearer?

Change "Cannot use 'tell' with interactive mode" to "Ceph 'tell' requires additional arguments, or interactive mode" ... ?

What do you think Kefu and Harish?
Comment 14 Harish NV Rao 2015-10-21 03:19:47 EDT
Hi Ken,

We need to change the message something like this:

"Ceph 'tell' requires additional arguments. <print usage for tell command>"

As per David, tell command is not supported in the interactive mode. if used in interactive mode, pull request  6329 will take care of handling it.

Regards,
Harish
Comment 15 Ken Dreyer (Red Hat) 2015-10-21 12:48:15 EDT
(additional ceph.in changes needed, re-targeting to RHCS 1.3.2)
Comment 21 Kefu Chai 2016-01-05 02:08:18 EST
Harish, Ken:

i reopened the upstream ticket, and post an updated fix at https://github.com/ceph/ceph/pull/7106.

could you help review it?

thanks.
Comment 22 Harish NV Rao 2016-01-05 03:55:34 EST
Kefu,

Message looks good to me.

Does the code change cover all of the following scenarios?
1) sudo ceph tell
2) sudo ceph tell mon.<id> # Don't provide any other arguments after mon.<id>
3) sudo ceph tell osd.<id> # Don't provide any other arguments after osd.<id>

Also, will the pull request 6329 be part of 1.3.2?

Regards,
Harish
Comment 24 Kefu Chai 2016-01-31 22:08:36 EST
merged upstream in master, pending backport.
Comment 25 Ken Dreyer (Red Hat) 2016-02-03 18:54:21 EST
This is ready to go into 1.3.2 - re-targeting for that release.
Comment 28 Harish NV Rao 2016-02-07 04:45:29 EST
The fix is working for below mentioned scenarios. 

[cephuser@magna003 ~]$ sudo ceph osd tell
"osd tell" is deprecated; try "tell osd.<id> <command> [options...]" instead (id can be "*") 

[cephuser@magna003 ~]$ sudo ceph tell osd.*
"/bin/ceph tell" requires additional arguments. Try "/bin/ceph tell <name> <command> [options...]" instead.

[cephuser@magna003 ~]$  sudo ceph tell
"/bin/ceph tell" requires additional arguments. Try "/bin/ceph tell <name> <command> [options...]" instead.

[cephuser@magna003 ~]$  sudo ceph tell mon.*
"/bin/ceph tell" requires additional arguments. Try "/bin/ceph tell <name> <command> [options...]" instead.

[cephuser@magna003 ~]$ sudo ceph tell osd.3
"/bin/ceph tell" requires additional arguments. Try "/bin/ceph tell <name> <command> [options...]" instead.

[cephuser@magna003 ~]$ sudo ceph tell osd.4 bench
{
    "bytes_written": 1073741824,
    "blocksize": 4194304,
    "bytes_per_sec": 53981114.000000
}

It's failing when tell command is used in ceph interactive shell. As per https://github.com/ceph/ceph/pull/6329, using 'tell' in interactive mode should have resulted in error message "Can not use 'tell' in interactive mode". 

[cephuser@magna003 ~]$ sudo ceph
ceph> tell
Invalid command:  missing required parameter target(<name (type.id)>)
tell <name (type.id)> <args> [<args>...] :  send a command to a specific daemon
Invalid command
ceph> tell  osd.4 bench 1024 4096
Error: 22 EINVAL
Status:
unrecognized command! [{"prefix": "tell", "args": ["bench", "1024", "4096"]}]
ceph> 

Looks like the pr 6329 is not included in latest build. Moving the BZ to assigned state.
Comment 29 Ken Dreyer (Red Hat) 2016-02-11 16:23:18 EST
You're right Harish, we missed this one.
Comment 30 Ken Dreyer (Red Hat) 2016-02-11 16:27:43 EST
David, in Comment #28 Harish describes how your PR 6329 fixes an issue with "ceph tell" in interactive mode.

Would you please open a Redmine ticket upstream to track fixing this in Hammer, and then cherry-pick the necessary changes to a wip branch for inclusion in hammer?
Comment 32 David Zafman 2016-02-15 16:12:07 EST
Created upstream tracker of backport to hammer: http://tracker.ceph.com/issues/14769

Created pull request: https://github.com/ceph/ceph/pull/7656
Comment 34 Mike McCune 2016-03-28 18:32:18 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 40 Vasishta 2016-09-14 08:43:04 EDT
Fix is working for interactive mode.

(Interactive mode)
ceph>tell mon.1
Can not use 'tell' in interactive mode.
ceph> tell
Can not use 'tell' in interactive mode.
ceph> tell osd.*
Can not use 'tell' in interactive mode.

(Non-interactive mode)
$ sudo ceph tell osd.4 bench
{
    "bytes_written": 1073741824,
    "blocksize": 4194304,
    "bytes_per_sec": 60039561.000000
}

$ sudo ceph tell mon.*
"/usr/bin/ceph tell" requires additional arguments. Try "/usr/bin/ceph tell <name> <command> [options...]" instead.
Comment 44 errata-xmlrpc 2016-09-29 08:54:40 EDT
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, 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://rhn.redhat.com/errata/RHSA-2016-1972.html

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