Bug 1305688
Summary: | oo-accept-broker incorrectly parses MONGO_HOST_PORT individual host and ports | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Dave Sullivan <dsulliva> |
Component: | Unknown | Assignee: | Vu Dinh <vdinh> |
Status: | CLOSED ERRATA | QA Contact: | Johnny Liu <jialiu> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 2.2.0 | CC: | aos-bugs, jokerman, mmccomas, rthrashe, vdinh |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | openshift-origin-broker-util-1.37.5.2-1.el6op | Doc Type: | Bug Fix |
Doc Text: |
Cause: oo-accept-broker doesn't filter the single or double quote from MONGO_HOST_PORT variable before parsing it.
Consequence: The individual host and port parsed from MONGO_HOST_PORT contain unwanted quote characters. When oo-accept-broker attempts to access to broker using those information, it fails. As a result, it generates a false result that oo-accept-broker fails.
Fix: The unwanted quote characters from MONGO_HOST_PORT will be removed before parsing.
Result: The oo-accept-broker command now has correct information about broker's host and port to determine if the broker is accessible.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-03-22 16:54:13 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: | |
Embargoed: |
Description
Dave Sullivan
2016-02-08 21:54:49 UTC
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/a9bcb953f3ec4d822b561e7fc22f4ddba5aa40c1 Bug 1305688 - oo-accept-broker incorrectly parses MONGO_HOST_PORT The validation of mongo replicant fails as the code in oo-accept-broker that is responsible to parse MONGO_HOST_PORT is not working correctly as it fails to remove unwanted quote characters in the variable. This commit fixes the code that is parsing the MONGO_HOST_PORT to remove the quote characters before performing the task. As a result, individual ports and hosts from MONGO_HOST_PORT are now parsed correctly. Bug 1305688 Link <https://bugzilla.redhat.com/show_bug.cgi?id=1305688> Signed-off-by: Vu Dinh <vdinh> Verified this bug with openshift-origin-broker-util-1.37.5.2-1.el6op.noarch, and PASS. # grep "MONGO_HOST" /etc/openshift/broker.conf # Eg: MONGO_HOST_PORT="<host1:port1>,<host2:port2>..." MONGO_HOST_PORT="localhost:27017" # oo-accept-broker -v <--snip--> INFO: checking Mongo host connectivity INFO: Connected to Mongo host: "localhost:27017" <--snip--> PASS Actually the PR is not landed into OSE puddle. # rpm -qf /usr/sbin/oo-accept-broker openshift-origin-broker-util-1.37.5.2-1.el6op.noarch # oo-accept-broker + verbose 'checking Mongo host connectivity' + '[' -n '' ']' ++ grep -e '^MONGO_HOST_PORT=' /etc/openshift/broker.conf ++ cut -d= -f2 + MONGO_HOST='"192.168.0.143:27017"' + [[ "192.168.0.143:27017" == *,* ]] ++ echo '"192.168.0.143:27017"' ++ cut -d: -f1 + host='"192.168.0.143' ++ echo '"192.168.0.143:27017"' ++ cut -d: -f2 + port='27017"' + timeout 1 bash -c 'cat </dev/null > /dev/tcp/"192.168.0.143/27017"' + '[' 0 '!=' 0 ']' + verbose 'Connected to Mongo host: "192.168.0.143:27017"' + '[' -n '' ']' + set +x PASS Interestingly, when I run testing using "localhost", no any error is reported in comment6, so pls ignore comment 6. After I modify "localhost" to "192.168.0.143", the issue is reproduced. QE, Sorry for the confusion earlier, this bug got put on the errata a bit too soon. Can we retest using the latest puddle and the instructions from comment #5? Thank you. Puddle: http://etherpad.corp.redhat.com/puddle-2-2-2016-02-19 Verified this bug with openshift-origin-broker-util-1.37.5.3-1.el6op.noarch, and PASS. # grep "MONGO_HOST" /etc/openshift/broker.conf # Eg: MONGO_HOST_PORT="<host1:port1>,<host2:port2>..." MONGO_HOST_PORT="192.168.0.143:27017,localhost:27017" # oo-accept-broker + verbose 'checking Mongo host connectivity' + '[' -n '' ']' ++ grep -e '^MONGO_HOST_PORT=' /etc/openshift/broker.conf ++ cut -d= -f2 + MONGO_HOST='"192.168.0.143:27017,localhost:27017"' + [[ "192.168.0.143:27017,localhost:27017" == *,* ]] + unreachable_count=0 + replica_count=0 ++ echo '"192.168.0.143:27017,localhost:27017"' ++ sed 's/,/ /g' + for mongo_replicant in '$(echo $MONGO_HOST | sed s/,/\ /g)' + (( replica_count++ )) ++ echo '"192.168.0.143:27017' ++ tr -d ''\''"' ++ cut -d: -f1 + host=192.168.0.143 ++ echo '"192.168.0.143:27017' ++ tr -d ''\''"' ++ cut -d: -f2 + port=27017 + timeout 1 bash -c 'cat </dev/null > /dev/tcp/192.168.0.143/27017' + '[' 0 '!=' 0 ']' + verbose 'Connected to Mongo replicant: "192.168.0.143:27017' + '[' -n '' ']' + for mongo_replicant in '$(echo $MONGO_HOST | sed s/,/\ /g)' + (( replica_count++ )) ++ cut -d: -f1 ++ tr -d ''\''"' ++ echo 'localhost:27017"' + host=localhost ++ echo 'localhost:27017"' ++ tr -d ''\''"' ++ cut -d: -f2 + port=27017 + timeout 1 bash -c 'cat </dev/null > /dev/tcp/localhost/27017' + '[' 0 '!=' 0 ']' + verbose 'Connected to Mongo replicant: localhost:27017"' + '[' -n '' ']' + '[' 0 == 2 ']' + verbose 'At least one Mongo replicant is listening on the specified host and port.' + '[' -n '' ']' + set +x PASS 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. https://rhn.redhat.com/errata/RHSA-2016-0489.html |