"Internal server error' with `okteto context use`

I’m seeing this error with “okteto context use.” I have a token set, but am hoping to use my own cluster with the CLI. Any ideas on how I can debug this further?

workspace@primary:~$ okteto context list
 !  Initializing context with the value of OKTETO_TOKEN environment variable
Name                        Namespace             Builder                              Registry
https://cloud.okteto.com *  bpmct                 tcp://buildkit.cloud.okteto.net:443  registry.cloud.okteto.net
default-context             coder-ws-bpmct-hello  docker                               -
workspace@primary:~$ okteto context use default-context
 !  Initializing context with the value of OKTETO_TOKEN environment variable
 x  Internal server error, please try again
workspace@primary:~$ okteto --log-level=debug context use default-context
 !  Initializing context with the value of OKTETO_TOKEN environment variable
 x  Internal server error, please try again

Hey @bpmct !

Couple of questions to get us started:

  • What version of the CLI are you using?
  • If you do okteto context use https://cloud.okteto.com, does it work?
  • Do you have OKTETO_TOKEN set in your environment?

Hi @bpmct,

I was able to reproduce the error you are describing and is indeed related to the OKTETO_TOKEN envvar as Ramiro is describing.

I opened an issue in the repo to track it: okteto context does not work properly with vanilla cluster with OKTETO_TOKEN envvar set · Issue #3467 · okteto/okteto · GitHub. Feel free to track it’s progress.

In the meantime disabling the envvar would work:

unset OKTETO_TOKEN

or alternatively:

OKTETO_TOKEN="" okteto context use default-context

The second option would be required for every command after that unfortunately.