Bug 1020473

Summary: SSH commands issued from rhc which exit with non-zero status result in "Success" and zero exit code from rhc itself
Product: OpenShift Online Reporter: Dan Mace <dmace>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: ffranz, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:25:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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