Openshift 3 – error: The server was unable to respond – verify you have provided the correct host and port and that the server is currently running.

This error occurred for me when I deleted a project on Openshift, created another one, which happened to end up on the us-west region whereas the deleted project had been on us-east.

$ oc login –config C:/******/.kube/config
Authentication required for https://api.starter-us-east-1.openshift.com:443 (openshift)
Username: **************
Password: **************
error: The server was unable to respond – verify you have provided the correct host and port and that the server is currently running.

Put the old .kube directory under the user profile aside.

$ mvdir ~/.kube ~/.kube.old

Run oc login once more and it prompts for the server and you just pass the new server.

https://api.starter-us-west-1.openshift.com:443

$ oc login
Server [https://localhost:8443]: https://api.starter-us-west-1.openshift.com:443

Authentication required for https://api.starter-us-west-1.openshift.com:443 (openshift)
Username: ************
Password:
Login successful.

You have one project on this server: “fireanote”

Using project “fireanote”.
Welcome! See ‘oc help’ to get started.