redhat-developer / odo

odo - Developer-focused CLI for fast & iterative container-based application development on Podman and Kubernetes. Implementation of the open Devfile standard.
https://odo.dev
Apache License 2.0
784 stars 243 forks source link

odo cannot connect to cluster after login #1151

Closed sherl0cks closed 5 years ago

sherl0cks commented 5 years ago

[kind/bug]

What versions of software are you using?

How did you run odo exactly?

see logs

Actual behavior

odo cannot connect to cluster. seems it is truncating https:// from the server url

Expected behavior

odo can talk to the server...

Any logs, error output, etc?

odo

[jholmes@fedora29 ~]$ rm -rf ~/.kube
[jholmes@fedora29 ~]$ odo login https://<my cluster>
The server uses a certificate signed by an unknown authority.
You can bypass the certificate check, but any data you send to the server could be intercepted by others.
Use insecure connections? (y/n): y

Authentication required for https://<my cluster>:443 (openshift)
Username: jholmes 
Password: 
Login successful.

You have access to the following projects and can switch between them with 'odo project <projectname>':

  * default
    other-cool-projects

Using project "default".
Welcome! See 'odo help' to get started.
[jholmes@fedora29 ~]$ odo project -v 10
I1218 14:37:42.856064   25529 loader.go:359] Config loaded from file /home/jholmes/.kube/config
I1218 14:37:42.856777   25529 occlient.go:392] Trying to connect to server <my cluster>:443
I1218 14:37:43.857040   25529 occlient.go:396] unable to connect to server: dial tcp: i/o timeout
I1218 14:37:43.857181   25529 cmdutils.go:19] Error:
Unable to connect to OpenShift cluster, is it down?
Unable to connect to OpenShift cluster, is it down?

oc

jholmes@fedora29 ~]$  rm -rf ~/.kube
[jholmes@fedora29 ~]$ oc login https://<my cluster>
The server uses a certificate signed by an unknown authority.
You can bypass the certificate check, but any data you send to the server could be intercepted by others.
Use insecure connections? (y/n): y

Authentication required for https://<my cluster>:443 (openshift)
Username: jholmes
Password: 
Login successful.

You have access to the following projects and can switch between them with 'oc project <projectname>':

  * default
    other-cool-projects

Using project "default".
Welcome! See 'oc help' to get started.
[jholmes@fedora29 ~]$ oc project --loglevel=10
I1218 14:37:14.848273   25499 loader.go:357] Config loaded from file /home/jholmes/.kube/config
I1218 14:37:14.849265   25499 round_trippers.go:417] curl -k -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: oc/v1.9.1+a0ce1bc657 (linux/amd64) kubernetes/a0ce1bc" -H "Authorization: Bearer rUIuuE7vVxtMIsnZqHN7wb9lkG6OwaBDidf9yjhi1bk" https://<my cluster>:443/apis/project.openshift.io/v1/projects/default
I1218 14:37:15.194028   25499 round_trippers.go:436] GET https://<my cluster>:443/apis/project.openshift.io/v1/projects/default 200 OK in 344 milliseconds
I1218 14:37:15.194117   25499 round_trippers.go:442] Response Headers:
I1218 14:37:15.194166   25499 round_trippers.go:445]     Cache-Control: no-store
I1218 14:37:15.194205   25499 round_trippers.go:445]     Content-Type: application/json
I1218 14:37:15.194256   25499 round_trippers.go:445]     Content-Length: 523
I1218 14:37:15.194288   25499 round_trippers.go:445]     Date: Tue, 18 Dec 2018 21:37:15 GMT
I1218 14:37:15.194406   25499 request.go:874] Response Body: {"kind":"Project","apiVersion":"project.openshift.io/v1","metadata":{"name":"default","selfLink":"/apis/project.openshift.io/v1/projects/default","uid":"f5a56be4-02d3-11e9-a284-fa163e810b8d","resourceVersion":"2413","creationTimestamp":"2018-12-18T14:48:19Z","annotations":{"openshift.io/node-selector":"","openshift.io/sa.scc.mcs":"s0:c1,c0","openshift.io/sa.scc.supplemental-groups":"1000000000/10000","openshift.io/sa.scc.uid-range":"1000000000/10000"}},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}}
Using project "default" on server "https://<my cluster>:443".
sherl0cks commented 5 years ago

~/.kube/config looks identical (apart from tokens) regardless of whether oc or odo creates it

sherl0cks commented 5 years ago

Bummer - was getting ready to build a demo with odo. looks like I need to do it with oc. I updated my oc to latest version (matching server) and nothing. Is there state outside of ~/.kube that I can clear?

jorgemoralespou commented 5 years ago

Can you test this one (and the other issue) with latest binary from master (https://dl.bintray.com/odo/odo/latest/)

sherl0cks commented 5 years ago

Looks like the issues are resolved. It was not the new client (as I did see some issues) right after switching. Perhaps some weird transient issues. I also test with minishift and things are back to normal. Sorry for noise.