Bug 1273623 - oc infinite loop on wrong password
oc infinite loop on wrong password
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Fabiano Franz
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-20 15:33 EDT by Aleksandar Kostadinov
Modified: 2016-01-05 03:30 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:16:06 EST
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)

  None (edit)
Description Aleksandar Kostadinov 2015-10-20 15:33:56 EDT
Description of problem:
oc login --username=aleks1 --password=mypasswrd --insecure-skip-tls-verify=true --server=https://myos.example.com:8443 --config=/home/slave4/workspace/Runner-v3/workdir/OS1-10.208-f22-4-0/ose_aleks1.kubeconfig

==> executes forever

Version-Release number of selected component (if applicable):
$ oc version
oc v3.0.2.0-17-g701346b
kubernetes v1.1.0-alpha.0-1605-g44c91b1

How reproducible:
always

Steps to Reproduce:
1. execute command in description
2. use non-existing username

Actual results:
never ends; looking at --v=8 it looks like trying to authenticate again and again forever

Expected results:
fail with bad login error or something like that
Comment 1 Fabiano Franz 2015-10-23 23:51:27 EDT
Fixed in https://github.com/openshift/origin/pull/5380
Comment 2 Fabiano Franz 2015-10-23 23:52:18 EDT
Note: in order to reproduce the bug master needs a provider that can actually return 401 errors, like the htpasswd provider for example.
Comment 3 Wei Sun 2015-10-27 05:30:45 EDT
Now there are no infinite loops,so verify this bug.

$ oc version
oc v3.0.2.903-29-g49953d6
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4


$ oc login --server=localhost:8443 --loglevel=8 
I1026 13:24:58.972504   24589 debugging.go:99] GET https://localhost:8443/
I1026 13:24:58.972573   24589 debugging.go:106] Request Headers:
I1026 13:24:58.972586   24589 debugging.go:109]     User-Agent: oc/v3.0.2.903 (linux/amd64) openshift/49953d6
I1026 13:24:59.006218   24589 debugging.go:124] Response Status:  in 33 milliseconds
I1026 13:24:59.006258   24589 debugging.go:127] Response Headers:
I1026 13:24:59.006398   24589 debugging.go:99] GET https://localhost:8443/oauth/authorize?response_type=token&client_id=openshift-challenging-client
I1026 13:24:59.006415   24589 debugging.go:106] Request Headers:
I1026 13:24:59.006425   24589 debugging.go:109]     X-Csrf-Token: 1
I1026 13:24:59.066322   24589 debugging.go:124] Response Status: 401 Unauthorized in 59 milliseconds
I1026 13:24:59.066367   24589 debugging.go:127] Response Headers:
I1026 13:24:59.066379   24589 debugging.go:130]     Www-Authenticate: Basic realm="openshift"
I1026 13:24:59.066391   24589 debugging.go:130]     Date: Mon, 26 Oct 2015 05:25:05 GMT
I1026 13:24:59.066400   24589 debugging.go:130]     Content-Length: 0
I1026 13:24:59.066410   24589 debugging.go:130]     Content-Type: text/plain; charset=utf-8
Authentication required for https://localhost:8443 (openshift)
Username: joe
Password: 
I1026 13:25:08.313810   24589 debugging.go:99] GET https://localhost:8443/oauth/authorize?response_type=token&client_id=openshift-challenging-client
I1026 13:25:08.313849   24589 debugging.go:106] Request Headers:
I1026 13:25:08.313868   24589 debugging.go:109]     X-Csrf-Token: 1
I1026 13:25:08.313887   24589 debugging.go:109]     Authorization: Basic am9lOnJlZGhhdA==
I1026 13:25:08.316699   24589 debugging.go:124] Response Status: 401 Unauthorized in 2 milliseconds
I1026 13:25:08.316764   24589 debugging.go:127] Response Headers:
I1026 13:25:08.316787   24589 debugging.go:130]     Content-Length: 0
I1026 13:25:08.316808   24589 debugging.go:130]     Content-Type: text/plain; charset=utf-8
I1026 13:25:08.316829   24589 debugging.go:130]     Www-Authenticate: Basic realm="openshift"
I1026 13:25:08.316850   24589 debugging.go:130]     Date: Mon, 26 Oct 2015 05:25:14 GMT
I1026 13:25:08.316931   24589 basicauth.go:42] already prompted for challenge, won't prompt again
Login failed (401 Unauthorized)

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