Bug 1020473 - SSH commands issued from rhc which exit with non-zero status result in "Success" and zero exit code from rhc itself
Summary: SSH commands issued from rhc which exit with non-zero status result in "Succe...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: oc
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-17 18:06 UTC by Dan Mace
Modified: 2015-05-15 02:25 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-24 03:25:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dan Mace 2013-10-17 18:06:46 UTC
Description of problem:

When executing an rhc command which internally uses `ssh_ruby` to issue an SSH command which returns a nonzero exit code, rhc will still report "Success" to the client and return a zero exit code. When issuing the same command via ssh directly, the correct error code is returned to the client.

Version-Release number of selected component (if applicable):


How reproducible:

Try the `rhc deploy ...` command with an invalid git ref which will produce an error that is still reported as zero/success by rhc.


Steps to Reproduce:
1. Create an unscaled nodejs-0.6 application
2. Run `rhc deploy bogusref -a nodeapp`
3. Compare the results to `ssh user@host "gear deploy bogusref"`

Actual results:

rhc reports success and a zero exit code. ssh reports failure and a non-zero exit code.


Expected results:

rhc to report failure and a nonzero exit code.

Additional info:

Comment 1 Fabiano Franz 2013-10-18 21:56:38 UTC
Fixed in pull request https://github.com/openshift/rhc/pull/487

Comment 2 Wei Sun 2013-10-21 06:06:22 UTC
Verified on devenv_3921,rhc build from devenv_3921

Result:
openshift@openshift-ubuntu:~/test$ rhc deploy bogusref -a nd
Deployment of git ref 'bogusref' in progress for application nd ...
Git ref bogusref is invalid
Error trying to deploy git ref. You can ssh to your application and try to deploy manually with:
gear deploy bogusref
SSH command finished with exit status = 255

openshift@openshift-ubuntu:~/test$ echo $?
133


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