
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
Let's say you are attemp to login to OpenShift using the oc login command and Error from server (InternalError): Internal error occurred: unexpected response: 500 is returned.
~]$ oc login -u john.doe
Authentication required for https://api.openshift.example.com:6443 (openshift)
Username: john.doe
Password:
Error from server (InternalError): Internal error occurred: unexpected response: 500
I once had this issue when I updated the htpasswd identity provider to use a different htpasswd file. I used the oc get users command and noticed that new users jack.doe and josh.doe had a different identity than prior users jane.doe and john.doe.
~]$ oc get users
NAME UID FULL NAME IDENTITIES
jack.doe 2d5443d8-bc39-4389-91b3-b6a1e53c26f4 htpaswd:jack.doe
jane.doe ad0d5d38-ad19-4e62-868f-f03e85897f1d htpasswd_provider:jane.doe
john.doe 127a869c-342a-4ea4-9f8e-9945276dc842 htpasswd_provider:john.doe
josh.doe 8eaf0f35-ddc7-4410-a477-36fc1430b2bc htpaswd:josh.doe
I saw similar output with the oc get identities command.
~]$ oc get identities
NAME IDP NAME IDP USER NAME USER NAME USER UID
htpasswd_provider:jane.doe htpasswd_provider jane.doe jane.doe ad0d5d38-ad19-4e62-868f-f03e85897f1d
htpasswd_provider:john.doe htpasswd_provider john.doe john.doe 127a869c-342a-4ea4-9f8e-9945276dc842
htpasswd:jack.doe htpasswd jack.doe jack.doe 2d5443d8-bc39-4389-91b3-b6a1e53c26f4
htpasswd:josh.doe htpasswd josh.doe josh.doe 8eaf0f35-ddc7-4410-a477-36fc1430b2bc
To resolve this, I deleted the prior users jane.doe and john.doe.
~]$ oc delete user jane.doe
user.user.openshift.io "jane.doe" deleted
~]$ oc delete user john.doe
user.user.openshift.io "john.doe" deleted
And also deleted the prior identities jane.doe and john.doe.
~]$ oc delete identity htpasswd_provider:jane.doe
identity.user.openshift.io "htpasswd_provider:jane.doe" deleted
~]$ oc delete identity htpasswd_provider:john.doe
identity.user.openshift.io "htpasswd_provider:john.doe" deleted
And then john.doe and jane.doe were able to sign in.
~]$ oc login -u jane.doe
Authentication required for https://api.openshift.example.com:6443 (openshift)
Username: jane.doe
Password:
Login successful.
~]$ oc login -u john.doe
Authentication required for https://api.openshift.example.com:6443 (openshift)
Username: john.doe
Password:
Login successful.
And then the oc get users command showed the users all had the same identities.
~]$ oc get users
NAME UID FULL NAME IDENTITIES
jack.doe 2d5443d8-bc39-4389-91b3-b6a1e53c26f4 htpasswd:jack.doe
jane.doe 00e05945-f219-4a43-a3e0-3946a749510f htpasswd:jane.doe
john.doe 0e72aa79-0014-4c55-9484-2ca6fcf1211a htpasswd:john.doe
josh.doe 8eaf0f35-ddc7-4410-a477-36fc1430b2bc htpasswd:josh.doe
And the oc get identities command show the users had the same identity provider.
~]$ oc get identities
NAME IDP NAME IDP USER NAME USER NAME USER UID
htpasswd:jane.doe htpasswd jane.doe jane.doe ad0d5d38-ad19-4e62-868f-f03e85897f1d
htpasswd:john.doe htpasswd john.doe john.doe 127a869c-342a-4ea4-9f8e-9945276dc842
htpasswd:jack.doe htpasswd jack.doe jack.doe 2d5443d8-bc39-4389-91b3-b6a1e53c26f4
htpasswd:josh.doe htpasswd josh.doe josh.doe 8eaf0f35-ddc7-4410-a477-36fc1430b2bc
Did you find this article helpful?
If so, consider buying me a coffee over at