lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.55k stars 1.47k forks source link

kubelogin not found #6678

Open petergaultney opened 1 year ago

petergaultney commented 1 year ago

Describe the bug

E1130 09:09:01.313973 10871 proxy_server.go:147] Error while proxying request: getting credentials: exec: executable kubelogin not found

getting credentials: exec: executable kubelogin not found

To Reproduce

Happens this morning when trying to connect to a cluster.

Expected behavior

It didn't happen yesterday and I've not seen this issue in a while.

Environment (please complete the following information):

Kubeconfig:

My kubeconfig is fine; I can run kubectl get nodes and it returns valid data. Same for k9s CLI tool.

Additional context

After 3 restarts of the application (not my computer), the problem magically resolved itself. However, the Lens application itself did not update. It seems you have a Heisenbug. I'm not sure how or why you'd be unable to find kubelogin after two restarts, but suddenly able to find it after the third restart.

Nokel81 commented 1 year ago

By restarting do you mean including quitting from the tray menu?

petergaultney commented 1 year ago

Yes!

Nokel81 commented 1 year ago

My only thought is that the first two times the shell env sync failed. If you check ~/Library/Logs/Lens does anything with shell-sync pop out?

petergaultney commented 1 year ago

grep -r "shell-sync" ~/Library/Logs/Lens gives no results.

grepping for sync on its own, I see a few places in the logs that look like this:

/Users/peter.gaultney/Library/Logs/Lens//lens2.log:info: [KUBECONFIG-SYNC]: starting sync of file/folder {"filePath":"/Users/peter.gaultney/Library/Application Support/Lens/kubeconfigs"}
/Users/peter.gaultney/Library/Logs/Lens//lens2.log:info: [KUBECONFIG-SYNC]: starting sync of file/folder {"filePath":"/Users/peter.gaultney/.kube"}
/Users/peter.gaultney/Library/Logs/Lens//lens2.log:debug: [KUBECONFIG-SYNC]: Added new cluster from sync {"contextName":"datascience","filePath":"/Users/peter.gaultney/.kube/config"}
/Users/peter.gaultney/Library/Logs/Lens//lens2.log:debug: [KUBECONFIG-SYNC]: Added new cluster from sync {"contextName":"dev-datascience","filePath":"/Users/peter.gaultney/.kube/config"}

and in two other places, i see:

/Users/peter.gaultney/Library/Logs/Lens//lens14.log:info: [LENS-SPACES-EXTENSION]: 11/21/2022, 5:35:15 PM Clearing syncSpaceInterval...
/Users/peter.gaultney/Library/Logs/Lens//lens14.log:info: [LENS-SPACES-EXTENSION]: 11/21/2022, 5:35:46 PM Starting syncSpaceInterval...
/Users/peter.gaultney/Library/Logs/Lens//lens14.log:error: [LENS-SPACES-EXTENSION]: 11/21/2022, 5:35:46 PM loadRemoteSpaces error Unexpected exception [Lens Platform SDK] {"errorCode":null,"rawException":{"code":"ECONNREFUSED", 

...

which looks like a failure to.... do something? In those cases I do not see any following messages about added new cluster from sync ...

petergaultney commented 1 year ago

i found this when adding -i:

error: [SHELL-SYNC]: Shell did not exit sucessfully: {
    "code": 127,
    "signal": null,
    "stdout": "",
    "stderr": "error: Unable to read input file: Is a directory\n"
}

i found 4 instances of these in the same log file. Those may have happened this morning; it's hard to tell because the lines themselves are not timestamped.

Needless to say, I can't tell what file it was trying to read that it thought was a directory. .kube is certainly a directory, but .kube/config is a regular file.

Nokel81 commented 1 year ago

@petergaultney Can you also post the logs for UNIX-SHELL-ENV and SHELL-ENV? Thanks

petergaultney commented 1 year ago
/Users/peter.gaultney/Library/Logs/Lens/lens.log:info: [UNIX-SHELL-ENV]: running against /bin/bash {"command":"'/Applications/Lens.app/Contents/MacOS/Lens' -p '\"3fc8a70847ad47d4b70135d8525317f1\" + JSON.stringify(process.env) + \"3fc8a70847ad47d4b70135d8525317f1\"'","shellArgs":["-l","-i"]}
/Users/peter.gaultney/Library/Logs/Lens/lens.log:info: [UNIX-SHELL-ENV]: running against /bin/bash {"command":"'/Applications/Lens.app/Contents/MacOS/Lens' -p '\"972f75815a4445338a24bc3f2cd0e19c\" + JSON.stringify(process.env) + \"972f75815a4445338a24bc3f2cd0e19c\"'","shellArgs":["-l","-i"]}

Nothing for just SHELL-ENV

I'm seeing the problem again today. Lens was working yesterday and now it isn't. It seems to be non-deterministic.