Bug 1316463
Summary: | Should give a meaningful error message while the auth info of login F5 server is incorrect | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | zhaozhanqi <zzhao> |
Component: | Networking | Assignee: | Miciah Dashiel Butler Masters <mmasters> |
Networking sub component: | router | QA Contact: | zhaozhanqi <zzhao> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | low | ||
Priority: | medium | CC: | aos-bugs, bmeng, hongli, tdawson |
Version: | 3.2.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Cause:
The F5 iControl REST API usually returns JSON payloads in its responses, but it sometimes returns error responses with HTML payloads. In particular, it can return HTML payloads with HTTP 401 and 404 responses. Previously, the router would always try to decode the payload as JSON.
Consequence:
If the F5 iControl REST API returned an HTML response, the router logs would show the following: "error: Decoder.Decode failed: invalid character '<' looking for beginning of value".
Fix:
The F5 router plugin now gracefully handles HTML responses by ignoring the response payload for HTTP 4xx and 5xx responses if decoding as JSON fails.
Result:
If the F5 iControl REST API returns an HTML response, the router logs will now show a message similar to the following: "error: HTTP code: 401."
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-09-27 09:36:16 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
zhaozhanqi
2016-03-10 10:20:13 UTC
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/cbcb389ecbfac939ec665750235627b734d2d61a F5: handle HTML responses gracefully The F5 iControl REST API sometimes returns error responses with HTML payloads instead of JSON. (This has been observed for HTTP 401 and 404 responses.) Gracefully handle such responses by ignoring the error and response payload for HTTP 4xx and 5xx responses if decoding fails. Before this commit, if the F5 iControl REST API returned an HTML response, the rest_request method would return an error that rendered as follows: error: Decoder.Decode failed: invalid character '<' looking for beginning of value After this commit the rest_request method will produce an error that renders similar to the following: error: HTTP code: 401." This commit fixes bug 1316463. https://bugzilla.redhat.com/show_bug.cgi?id=1316463 This has been merged into ose and is in OSE v3.3.0.28 or newer. Verified in 3.3.0.28 and logs as below (return 401): root@ip-10-3-89-142 ~]# [root@ip-10-3-89-142 ~]# oc logs f5router-3-35hsz W0902 05:36:20.713635 1 f5.go:243] Strict certificate verification is *DISABLED* E0902 05:36:22.502276 1 f5.go:699] partition path "/Common" error: Encountered an error on GET request to URL https://10.3.88.53/mgmt/tm/sys/folder/~Common: HTTP code: 401. error: Encountered an error on GET request to URL https://10.3.88.53/mgmt/tm/sys/folder/~Common: HTTP code: 401. [root@ip-10-3-89-142 ~]# 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://access.redhat.com/errata/RHBA-2016:1933 |