Bug 1020473 - SSH commands issued from rhc which exit with non-zero status result in "Success" and zero exit code from rhc itself
SSH commands issued from rhc which exit with non-zero status result in "Succe...
Product: OpenShift Online
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-10-17 14:06 EDT by Dan Mace
Modified: 2015-05-14 22:25 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-23 22:25:00 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dan Mace 2013-10-17 14:06:46 EDT
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 17:56:38 EDT
Fixed in pull request https://github.com/openshift/rhc/pull/487
Comment 2 Wei Sun 2013-10-21 02:06:22 EDT
Verified on devenv_3921,rhc build from devenv_3921

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 $?

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