Bug 978837 - Exception log output when using rhc app ssh --ssh with a wrong execute path
Summary: Exception log output when using rhc app ssh --ssh with a wrong execute path
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Clayton Coleman
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-27 08:09 UTC by Yan Du
Modified: 2015-05-15 02:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-22 15:18:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yan Du 2013-06-27 08:09:29 UTC
Description of problem:
create a app and try to rhc ssh the app with a wrong execute path by using --ssh parameter
(eg: rhc app ssh -a existapp --ssh  /usr/bin/abcd ), just exception log output.


Version-Release number of selected component (if applicable):
STG(devenv-stage_381)
rhc-1.10.7



How reproducible:
Always



Steps to Reproduce:
1. Create an app 
$ rhc app create app4 nodejs-0.6

2. ssh the app with a wrong execute path
$ rhc app ssh -a app4 --ssh /usr/bin/abcd



Actual results:
OpenShift:test duyan$ rhc app ssh -a app4 --ssh  /usr/bin/abcd
Connecting to 51cbea1d2587c84fc300003b.rhcloud.com ...
/usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rhc-1.10.7/lib/rhc/commands/ssh.rb:47:in `exec': No such file or directory - /usr/bin/abcd (Errno::ENOENT)
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rhc-1.10.7/lib/rhc/commands/ssh.rb:47:in `run'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rhc-1.10.7/lib/rhc/commands.rb:244:in `execute'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rhc-1.10.7/lib/rhc/commands.rb:235:in `block (3 levels) in to_commander'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/runner.rb:400:in `run_active_command'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rhc-1.10.7/lib/rhc/command_runner.rb:73:in `run!'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rhc-1.10.7/lib/rhc/cli.rb:36:in `start'
        from /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/rhc-1.10.7/bin/rhc:20:in `<top (required)>'
        from /usr/local/opt/ruby/bin/rhc:23:in `load'
        from /usr/local/opt/ruby/bin/rhc:23:in `<main>'



Expected results:
should get a friendly message when using rhc app ssh --ssh, just like "/usr/bin/abcd  is not existing" instead of the exception log.

Comment 1 Clayton Coleman 2013-06-27 19:22:45 UTC
Fixed in https://github.com/openshift/rhc/pull/418

Comment 2 openshift-github-bot 2013-06-27 21:33:55 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/b6f4b8b0343d1959da397662f9399a00c1fea4ba
Bug 978837 - Don't show stack trace if --ssh executable not found

rhc app ssh --ssh /path/to/nowhere should return a short error
(not found or not executable) to the user instead of a stack trace.

Comment 3 Yan Du 2013-06-28 03:11:14 UTC
test on devenv_3427 , issue still can be reproduced.
rhc-1.10.7

Steps:
1. create a app
   rhc app create app2 php-5.3

2. ssh into app with a wrong execute path

[root@Daphne ~]# rhc app ssh -a app2 --ssh  /usr/bin/abcd
Connecting to 765578476596905210019840.rhcloud.com ...
/usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/commands/ssh.rb:47:in `exec': No such file or directory - /usr/bin/abcd (Errno::ENOENT)
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/commands/ssh.rb:47:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/commands/ssh.rb:47:in `run'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/commands.rb:244:in `send'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/commands.rb:244:in `execute'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/commands.rb:235:in `to_commander'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:180:in `call'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/command.rb:155:in `run'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/runner.rb:400:in `run_active_command'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/command_runner.rb:73:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/commander-4.1.3/lib/commander/delegates.rb:7:in `run!'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/lib/rhc/cli.rb:36:in `start'
	from /usr/lib/ruby/gems/1.8/gems/rhc-1.10.7/bin/rhc:20
	from /usr/bin/rhc:19:in `load'
	from /usr/bin/rhc:19

Comment 4 Yan Du 2013-06-28 03:31:12 UTC
use rhc-1.11.1 for test on devenv_3427, issue still can be reproduced.

Comment 5 Xiaoli Tian 2013-06-28 05:04:53 UTC
Move back to ON_QA since comment 3 and comment 4 is not testing with the version with the fix, 

Yan, you need to test it with the rhc installed on the latest devenv or build one from the latest code.

Comment 6 Yan Du 2013-06-28 05:45:18 UTC
verified on devenv_3427 with the rhc client build from devenv_3427 on Linux/Mac/Windows plaform, issue can't be reproduced. move to verified.

Steps:
1. create a app
   rhc app create app2 php-5.3

2. ssh into app with a wrong execute path

OpenShift:~ $  rhc app ssh -a phps --ssh /usr/bin/abcd
invalid option: SSH executable '/usr/bin/abcd' does not exist.


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