Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1106414 - psql wrapper always return zero even if psql command is already failed.
psql wrapper always return zero even if psql command is already failed.
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
2.1.0
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Brenton Leanhardt
libra bugs
: Upstream
Depends On: 1106413
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-09 05:46 EDT by Johnny Liu
Modified: 2014-08-26 09:52 EDT (History)
6 users (show)

See Also:
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.
Story Points: ---
Clone Of: 1106413
Environment:
Last Closed: 2014-08-26 09:52:20 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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1095 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.5 bug fix and enhancement update 2014-08-26 13:51:34 EDT

  None (edit)
Description Johnny Liu 2014-06-09 05:46:40 EDT
+++ 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 05:48:03 EDT
This issue also reproduced in 2.1.z/2014-05-29.3
Comment 2 Jakub Hadvig 2014-06-12 06:26:22 EDT
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 09:17:43 EDT
Upstream commit:

[enterprise-2.1 4b32b39] Bug 1106413: psql wrapper always return zero even if psql command is already failed
 Author: jhadvig <jhadvig@redhat.com>
 1 file changed, 4 insertions(+), 1 deletion(-)
Comment 6 Johnny Liu 2014-08-04 02:09:16 EDT
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 09:52:20 EDT
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.