OpenLens failing to start — Failed to start connection: ValidationError: “current-context” is not allowed to be empty
Starting from yesterday, Wednesday November 15th 2023, I sometimes get an error when clicking on any cluster in the “Catalog” in OpenLens. The error is: “Failed to start connection: ValidationError: “current-context” is not allowed to be empty”.
It turns out to be easy to fix, following advice in https://github.com/lensapp/lens/issues/7826. The error is caused by an empty string, “”, as value for the “current-context” parameter:
The fix is simply to open the file ~/.kube/config, finding the empty string “” value for current-context in the “contexts” section, and changing it to be non-empty, for example by adding a space. That is, just substitute the value “” with “ “.