Bug 1193710 - ceph tell: broken error message / wrong hinting
Summary: ceph tell: broken error message / wrong hinting
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RADOS
Version: 1.2.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 1.3.3
Assignee: David Zafman
QA Contact: Vasishta
Bara Ancincova
URL:
Whiteboard:
Depends On: 1335269
Blocks: 1372735
TreeView+ depends on / blocked
 
Reported: 2015-02-17 22:55 UTC by Federico Lucifredi
Modified: 2022-07-09 07:49 UTC (History)
6 users (show)

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.
Clone Of:
Environment:
Last Closed: 2016-09-29 12:54:40 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 11101 0 None None None Never
Red Hat Issue Tracker RHCEPH-3238 0 None None None 2022-02-21 18:11:55 UTC
Red Hat Product Errata RHSA-2016:1972 0 normal SHIPPED_LIVE Moderate: Red Hat Ceph Storage 1.3.3 security, bug fix, and enhancement update 2016-09-29 16:51:21 UTC

Description Federico Lucifredi 2015-02-17 22:55:07 UTC
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 19:03:38 UTC
probably need a bug upstream

Comment 2 Federico Lucifredi 2015-03-11 19:58:25 UTC
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 19:59:29 UTC
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 15:43:59 UTC
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 04:57:16 UTC
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-15 01:13:11 UTC
Kefu, do you mind taking this one, or re-assigning as appropriate?

Comment 7 Kefu Chai 2015-07-15 11:10:40 UTC
pending on review: https://github.com/ceph/ceph/pull/5249

Comment 8 Ken Dreyer (Red Hat) 2015-07-15 15:44:21 UTC
Thanks Kefu!

Comment 9 Ken Dreyer (Red Hat) 2015-07-30 20:14:36 UTC
Patches to cherry-pick downstream: https://github.com/ceph/ceph/pull/5371/commits

Comment 12 Harish NV Rao 2015-10-20 11:00:01 UTC
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 17:19:48 UTC
(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 07:19:47 UTC
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 16:48:15 UTC
(additional ceph.in changes needed, re-targeting to RHCS 1.3.2)

Comment 21 Kefu Chai 2016-01-05 07:08:18 UTC
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 08:55:34 UTC
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-02-01 03:08:36 UTC
merged upstream in master, pending backport.

Comment 25 Ken Dreyer (Red Hat) 2016-02-03 23:54:21 UTC
This is ready to go into 1.3.2 - re-targeting for that release.

Comment 28 Harish NV Rao 2016-02-07 09:45:29 UTC
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 21:23:18 UTC
You're right Harish, we missed this one.

Comment 30 Ken Dreyer (Red Hat) 2016-02-11 21:27:43 UTC
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 21:12:07 UTC
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 22:32:18 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 40 Vasishta 2016-09-14 12:43:04 UTC
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 12:54:40 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, 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.