Bug 1106414 - psql wrapper always return zero even if psql command is already failed.
Summary: psql wrapper always return zero even if psql command is already failed.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Brenton Leanhardt
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1106413
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-09 09:46 UTC by Johnny Liu
Modified: 2014-08-26 13:52 UTC (History)
6 users (show)

Fixed In Version: rubygem-openshift-origin-node-1.23.9.15-1.el6op
Doc Type: Bug Fix
Doc Text:
The rhcsh command that is used for interactive gear logins had a bug in the psql function. This function wraps the actual command-line tool to automatically provide database access credentials, but it always returned exit code 0, even when the command had actually failed. This issue could confuse scripts using the function. This bug fix updates the rhcsh command to preserve the exit code correctly, and the psql function exits as expected as a result. Users must reconnect to their gear using SSH to pick up the new function after applying this fix.
Clone Of: 1106413
Environment:
Last Closed: 2014-08-26 13:52:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1095 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.5 bug fix and enhancement update 2014-08-26 17:51:34 UTC

Description Johnny Liu 2014-06-09 09:46:40 UTC
+++ This bug was initially created as a clone of Bug #1106413 +++

Description of problem:
Check psql wrapper function in /usr/bin/rhcsh, psql command's return value is always return 0.

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

How reproducible:
Always

Steps to Reproduce:
1.Create app, and embed postgresql.
2.Log into this app, run psql command with non-existing file.
> psql -f xx; echo $?
psql: FATAL:  password authentication failed for user "admin1hygbvy"
0
3.

Actual results:
It always return 0.

Expected results:
Psql wrapper should return non-zero value when psql command is failed.

Additional info:

Comment 1 Johnny Liu 2014-06-09 09:48:03 UTC
This issue also reproduced in 2.1.z/2014-05-29.3

Comment 2 Jakub Hadvig 2014-06-12 10:26:22 UTC
This issue has been fixed and verified on the Online: 
https://bugzilla.redhat.com/show_bug.cgi?id=1106413

Comment 3 Brenton Leanhardt 2014-08-01 13:17:43 UTC
Upstream commit:

[enterprise-2.1 4b32b39] Bug 1106413: psql wrapper always return zero even if psql command is already failed
 Author: jhadvig <jhadvig>
 1 file changed, 4 insertions(+), 1 deletion(-)

Comment 6 Johnny Liu 2014-08-04 06:09:16 UTC
Verified this bug with puddle-2-1-2014-08-01, and PASS.

> psql -f xx.conf; echo $?
xx.conf: No such file or directory
1

Comment 8 errata-xmlrpc 2014-08-26 13:52:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1095.html


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