Bug 1806620

Summary: User unable to login when ldap query times out even when htpasswd IDP credentials are used.
Product: OpenShift Container Platform Reporter: Venkata Siva Teja Areti <vareti>
Component: apiserver-authAssignee: Venkata Siva Teja Areti <vareti>
Status: CLOSED ERRATA QA Contact: scheng
Severity: medium Docs Contact:
Priority: medium    
Version: 4.3.0CC: ahoffer, aos-bugs, mfojtik, slaznick, sttts, wgordon
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 1814898 (view as bug list) Environment:
Last Closed: 2020-07-13 17:20:43 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:
Bug Depends On:    
Bug Blocks: 1814898    

Description Venkata Siva Teja Areti 2020-02-24 16:09:10 UTC
Description of problem:
When both ldap and htpasswd IDPs are configured, and if LDAP query took more time than allowed Request timeout(default is 60s), user fails to login when credentials from htpasswd are used. Even though request timeout exceeds, it seems logical to try the other IDP.

login succeeds if the order of htpasswd and ldap IDPs are reversed.

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

How reproducible:
Always

Steps to Reproduce:
1. Apply ldap IDP followed by htpasswd IDP
2. break the connection between ldap server and oauth-server. I achieved this by changing ldap server port number 
3. trying to login as user configured in in htpasswd using `oc login` 

Actual results:
login fails with "Error from server (InternalError): Internal error occurred: unexpected response: 504"


Expected results:
login to succeed


Additional info:

Comment 2 Standa Laznicka 2020-02-25 11:00:52 UTC
I think this must have been there at least since 4.1. A solution to consider is to set the timeout the ldap library uses for connections (not the timelimit for searches, that's different) to half/portion of our request timeout. Ref: https://github.com/go-ldap/ldap/blob/bb7a9ca6e4fbc2129e3db588a34bc970ffe811a9/conn.go#L107

Comment 7 errata-xmlrpc 2020-07-13 17:20:43 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-2020:2409