Bug 1316463 - Should give a meaningful error message while the auth info of login F5 server is incorrect
Summary: Should give a meaningful error message while the auth info of login F5 server...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 3.2.0
Hardware: All
OS: All
medium
low
Target Milestone: ---
: ---
Assignee: Miciah Dashiel Butler Masters
QA Contact: zhaozhanqi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-10 10:20 UTC by zhaozhanqi
Modified: 2022-08-04 22:20 UTC (History)
4 users (show)

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."
Clone Of:
Environment:
Last Closed: 2016-09-27 09:36:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 13:24:36 UTC

Description zhaozhanqi 2016-03-10 10:20:13 UTC
Description of problem:
When creating F5 router with incorrect user/pass. the logs is not clear.

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


How reproducible:
always

Steps to Reproduce:
1. Create F5 router with incorrct username (--external-host-username)
  
2. Check the router logs
3.

Actual results:
step 2:

oc logs router-1-av2naW0309 02:52:55.159149    2234 reflector.go:289] pkg/admission/limitranger/admission.go:146: watch of *api.LimitRange ended with: 401: The event in requested index is outdated and cleared (the requested history has been cleared [192/83]) [1191]

W0309 07:52:27.537094       1 f5.go:243] Strict certificate verification is *DISABLED*
E0309 07:52:30.075312       1 f5.go:700] partition path "/Common" error: Encountered an error on GET request to URL https://10.3.88.53/mgmt/tm/sys/folder/~Common: error: Decoder.Decode failed: invalid character '<' looking for beginning of value
error: Encountered an error on GET request to URL https://10.3.88.53/mgmt/tm/sys/folder/~Common: error: Decoder.Decode failed: invalid character '<' looking for beginning of value

Expected results:
should give a meaningful error message

Additional info:

Comment 1 Miciah Dashiel Butler Masters 2016-03-10 17:41:38 UTC
PR: https://github.com/openshift/origin/pull/7907

Comment 2 openshift-github-bot 2016-04-26 14:01:05 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

Comment 3 Troy Dawson 2016-09-01 15:26:53 UTC
This has been merged into ose and is in OSE v3.3.0.28 or newer.

Comment 5 Hongan Li 2016-09-02 09:51:27 UTC
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 ~]#

Comment 7 errata-xmlrpc 2016-09-27 09:36:16 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.

https://access.redhat.com/errata/RHBA-2016:1933


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