Bug 978837 - Exception log output when using rhc app ssh --ssh with a wrong execute path
Exception log output when using rhc app ssh --ssh with a wrong execute path
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Clayton Coleman
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-27 04:09 EDT by Yan Du
Modified: 2015-05-14 22:23 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-22 11:18:26 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)

  None (edit)
Description Yan Du 2013-06-27 04:09:29 EDT
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@app4-test.stg.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 15:22:45 EDT
Fixed in https://github.com/openshift/rhc/pull/418
Comment 2 openshift-github-bot 2013-06-27 17:33:55 EDT
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-27 23:11:14 EDT
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@app2-111.dev.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-27 23:31:12 EDT
use rhc-1.11.1 for test on devenv_3427, issue still can be reproduced.
Comment 5 Xiaoli Tian 2013-06-28 01:04:53 EDT
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 01:45:18 EDT
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.