lensapp / lens

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

Lens on Windows 10 unable to use kubectl from WSL system #7882

Open radonthetyrant opened 1 year ago

radonthetyrant commented 1 year ago

Describe the bug When Lens is installed on a Win 10 and kubectl is installed in the WSL ubuntu linux subsystem, with configuration pointing the binary folder to where kubectl resides seems to not work. In my example, the WSL kubectl had the oidc-login plugin installed and configured, the kubectl oidc-login get-token works when executed manually, but the Lens UI shows error:

error: unknown command "oidc-login" for "kubectl"

E0802 18:32:37.205765 10604 proxy_server.go:147] Error while proxying request: getting credentials: exec: executable kubectl failed with exit code 1

To Reproduce Steps to reproduce the behavior:

  1. Install Lens on Win 10
  2. Setup kubectl with oidc-login on WSL linux subsystem, confirm it works there
  3. Configure Lens to use WSL paths (see screenshots below)
  4. Try to connect to any cluster requiring oidc-login

Expected behavior Lens should use the actual kubectl binary path from the configuration

Screenshots

Confirmation that oidc-login works in WSL ubuntu: ![image](https://github.com/lensapp/lens/assets/4189978/9578e91a-b26d-415e-ad8b-ff18581bd686)
Preferences/Kube: ![image](https://github.com/lensapp/lens/assets/4189978/9749010d-d392-4485-b4bc-5c27faab7ddf)
Preferences/Terminal: ![image](https://github.com/lensapp/lens/assets/4189978/dbad22e4-ff5d-48c6-a950-039acb8a511a)
The error in Lens: ![image](https://github.com/lensapp/lens/assets/4189978/b1904ca7-ac65-4954-94b8-0e18d98f05ee)

Environment (please complete the following information):

Logs: When you run the application executable from command line you will see some logging output. Please paste them here:

complete application log from startup, to error, to shutdown ``` info: [LENS-EXTENSIONS]: LOADING ... info: [LENS-EXTENSIONS]: LOADED from C:\Users\radon\AppData\Roaming\Lens\lens-extensions.json info: Starting v2023.5.310801-latest of Lens... debug: Set kubectl version 1.23.3 for cluster version 1.23.3 using version map info: 🔌 Starting LensProxy info: [LENS-PROXY]: Proxy server has started at 127.0.0.1:55493 info: 🔎 Testing LensProxy connection ... info: [LENS-USER-STORE]: LOADING ... debug: [USER-PREFERENCES]: fromStore() {"preferences":{"downloadBinariesPath":"\\\\wsl.localhost\\Ubuntu-22.04\\usr\\local\\bin","downloadKubectlBinaries":false,"editorConfiguration":{"fontFamily":"RobotoMono","fontSize":12,"lineNumbers":"on","minimap":{"enabled":true,"side":"right"},"tabSize":2},"kubectlBinariesPath":"\\\\wsl.localhost\\Ubuntu-22.04\\usr\\local\\bin","shell":"wsl.exe","syncKubeconfigEntries":[{"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"}],"terminalConfig":{"fontFamily":"RobotoMono","fontSize":12},"updateChannel":"latest"}} info: [LENS-USER-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\lens-user-store.json info: [LENS-CLUSTER-STORE]: LOADING ... info: [LENS-CLUSTER-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\lens-cluster-store.json info: ⚡ LensProxy connection OK info: 📟 Setting protocol client for lens:// info: 📟 Protocol client register succeeded ✅ debug: [APP-MAIN] initializing ipc main handlers info: [CREATE-ELECTRON-WINDOW]: Loading content for window "splash" from file: C:\Users\radon\AppData\Local\Programs\Lens\resources\app.asar\static\splash.html... info: [LENS-FILESYSTEM-PROVISIONER-STORE]: LOADING ... info: [LENS-FILESYSTEM-PROVISIONER-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\lens-filesystem-provisioner-store.json info: 🐚 Syncing shell environment info: [LENS-WEBLINK-STORE]: LOADING ... info: [LENS-WEBLINK-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\lens-weblink-store.json debug: [SHELL-SYNC]: nothing to do, env not special in shells info: [LENS-HOTBAR-STORE]: LOADING ... info: [LENS-HOTBAR-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\lens-hotbar-store.json info: 🧩 Initializing extensions info: [EXTENSIONS-LOADER]: auto initializing extensions info: [CLOUD-PROVIDER-SYNC-EXTENSION] activated info: [LENS-DESKTOP-KUBE] onActivate info: [LDK-STORE]: LOADING ... info: [LDK-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\lens-desktop-kube-lens-extension\ldk-store.json info: [SECURITY-PREFERENCES-STORE]: LOADING ... info: [SECURITY-PREFERENCES-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\oci-image-lens-extension\security-preferences-store.json debug: [IPC-RENDERER]: adding extension handler {"channel":"logs:export","extension":{"name":"@lensapp/support-lens-extension","version":"0.12.0"}} info: [SUPPORT-EXTENSION] activated info: [PREFERENCES-STORE]: LOADING ... info: [PREFERENCES-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\survey-lens-extension\preferences-store.json info: [TOUR-EXTENSION] activated info: [TIP-STORE]: LOADING ... info: [TIP-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\tour-lens-extension\tip-store.json debug: [IPC-RENDERER]: adding extension handler {"channel":"clustersecurity:settings:open","extension":{"name":"@lensapp/tour-lens-extension","version":"1.7.1"}} debug: [CLOUD-PROVIDER-SYNC-EXTENSION] has cloud provider clis: info: [PREFERENCES-STORE]: LOADING ... info: [PREFERENCES-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\telemetry-lens-extension\preferences-store.json info: [LOCAL-METADATA-STORE]: LOADING ... info: [LOCAL-METADATA-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\lenscloud-lens-extension\local-metadata-store.json info: [RELEASE-NOTES-STORE]: LOADING ... info: [RELEASE-NOTES-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\lenscloud-lens-extension\release-notes-store.json info: [END-OF-TRIAL-STORE]: LOADING ... info: [END-OF-TRIAL-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\lenscloud-lens-extension\end-of-trial-store.json info: [GRACE-PERIOD-STORE]: LOADING ... info: [GRACE-PERIOD-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\lenscloud-lens-extension\grace-period-store.json info: [SPACES-SETTINGS-STORE]: LOADING ... info: [SPACES-SETTINGS-STORE]: LOADED from C:\Users\radon\AppData\Roaming\Lens\extension-store\lenscloud-lens-extension\spaces-settings-store.json info: [LENS-SPACES-EXTENSION]: 02/08/2023, 18:44:41 Broadcasted spaces change to SpacesListener on renderer warn: [LENS-SPACES-EXTENSION]: 02/08/2023, 18:44:41 No spaces in SpaceSyncer disposeSpacesReaction, not changing selected space. debug: [IPC-RENDERER]: adding extension listener {"channel":"disconnectClusterEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension listener {"channel":"deleteOneSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"forceRefreshToken","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"disconnectProxiedClustersEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"resetSpaceSyncerEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"stopTokenRefresherEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"getSpaceSyncerSpaces","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension listener {"channel":"loadRemoteSpacesClusters","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension listener {"channel":"createOneSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension listener {"channel":"leaveOneSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: adding extension listener {"channel":"selectSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} info: [LENS-SPACES-EXTENSION]: 02/08/2023, 18:44:41 Lens Spaces Extension activated debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:db:import","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:settings:open","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"clustersecurity:settings:open","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:db:export","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"csv:export","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:db:info","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:clear","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:scan:image","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:scan:storage","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vulnerabilities:scan:enabled","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"image:manifest","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"image:tag","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"image:manifest-list","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"image:history","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"image:vulnerabilities","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} info: [LENS-SECURITY] activated info: [CREATE-ELECTRON-WINDOW]: Window "splash" loaded warn: [LENS-SPACES-EXTENSION]: (from:onRefreshTokenError) 02/08/2023, 18:44:41 InvalidGrantError error, reset Lens state and set connected=false... Offline user session not found {"stack":"Error: Offline user session not found\n at t.refreshTokens (C:\\Users\\radon\\AppData\\Local\\Programs\\Lens\\resources\\app.asar\\node_modules\\@lensapp\\lenscloud-lens-extension\\dist\\main.js:2:31016)\n at process.processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async AuthTokenStore.refresh (C:\\Users\\radon\\AppData\\Local\\Programs\\Lens\\resources\\app.asar\\node_modules\\@lensapp\\lenscloud-lens-extension\\dist\\main.js:2:45593)"} info: [LENS-SPACES-EXTENSION]: (from:resetSpaceSyncer) Clearing spaces/k8sClusters... error: [LENS-SPACES-EXTENSION]: 02/08/2023, 18:44:41 Error: Offline user session not found warn: [LENS-SPACES-EXTENSION]: 02/08/2023, 18:44:41 Couldn't refresh tokens, starting token refresher later. info: [LENS-SPACES-EXTENSION]: 02/08/2023, 18:44:41 isLensCloudStatusOk on initialization returns true debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:enabled","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:start","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:stop","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:reset","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:delete","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:installDockerContext","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:uninstallDockerContext","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:download:pause","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:download:resume","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:download:cancel","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:create","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:update","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:profiles:get","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:getDockerInstallStatus","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"k0s:versions:get","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"extension:enable","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:cluster:active","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:cluster:isLdkClusterPath","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:cluster:getId","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: adding extension handler {"channel":"vm:os:compatibility","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} warn: [LENS-DESKTOP-KUBE] not a valid lens subscription, stopping ... info: [EXTENSION]: enabled @lensapp/cloud-provider-sync-extension@0.2.0 info: [EXTENSION]: enabled @lensapp/lens-desktop-kube-lens-extension@0.28.1 info: [EXTENSION]: enabled @lensapp/lens-license-extension@0.14.0 info: [EXTENSION]: enabled @lensapp/lenscloud-lens-extension@1.32.2 info: [EXTENSION]: enabled @lensapp/oci-image-lens-extension@0.29.2 info: [EXTENSION]: enabled @lensapp/support-lens-extension@0.12.0 info: [EXTENSION]: enabled @lensapp/survey-lens-extension@0.6.0 info: [EXTENSION]: enabled @lensapp/telemetry-lens-extension@0.8.0 info: [EXTENSION]: enabled @lensapp/tour-lens-extension@1.7.1 info: [EXTENSION-DISCOVERY] loading extensions from C:\Users\radon\AppData\Roaming\Lens debug: [EXTENSION-DISCOVERY]: 0 extensions loaded {"extensions":[],"folderPath":"C:\\Users\\radon\\.k8slens\\extensions"} info: [EXTENSION-DISCOVERY] watching extension add/remove in C:\Users\radon\.k8slens\extensions info: [CREATE-ELECTRON-WINDOW]: Loading content for window "first-application-window" from url: https://lens.app:55493... info: [CLI] inspecting registry info: [KUBECONFIG-SYNC]: starting requested syncs info: [KUBECONFIG-SYNC]: starting sync of file/folder {"filePath":"C:\\Users\\radon\\AppData\\Roaming\\Lens\\kubeconfigs"} debug: [KUBECONFIG-SYNC]: 1 files/folders watched {"files":["C:\\Users\\radon\\AppData\\Roaming\\Lens\\kubeconfigs"]} info: [KUBECONFIG-SYNC]: starting sync of file/folder {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"} debug: [KUBECONFIG-SYNC]: 2 files/folders watched {"files":["C:\\Users\\radon\\AppData\\Roaming\\Lens\\kubeconfigs","\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"]} debug: [KUBECONFIG-SYNC]: file changed {"filePath":"C:\\Users\\radon\\AppData\\Roaming\\Lens\\kubeconfigs\\c4007f91-3198-497b-873f-99c62ef067fc"} error: [KUBECONFIG-SYNC]: watching file/folder failed: Error: EISDIR: illegal operation on a directory, watch '//wsl.localhost/Ubuntu-22.04/home/radon/.kube' {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"} error: [KUBECONFIG-SYNC]: watching file/folder failed: Error: EISDIR: illegal operation on a directory, watch '\\wsl.localhost\Ubuntu-22.04\home\radon\.kube\kubectx' {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"} debug: [KUBECONFIG-SYNC]: file changed {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\kubectx"} error: [KUBECONFIG-SYNC]: watching file/folder failed: Error: EISDIR: illegal operation on a directory, watch '\\wsl.localhost\Ubuntu-22.04\home\radon\.kube\config' {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"} debug: [KUBECONFIG-SYNC]: file changed {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\config"} debug: [KUBECONFIG-SYNC]: File now has 0 entries {"filePath":"C:\\Users\\radon\\AppData\\Roaming\\Lens\\kubeconfigs\\c4007f91-3198-497b-873f-99c62ef067fc"} debug: [KUBECONFIG-SYNC]: Finished computing diff {"filePath":"C:\\Users\\radon\\AppData\\Roaming\\Lens\\kubeconfigs\\c4007f91-3198-497b-873f-99c62ef067fc"} warn: [KUBECONFIG-SYNC]: encountered errors while loading config: "value" must be of type object {"details":[{"context":{"label":"value","type":"object","value":"prod-staff@prod-app.myapp"},"message":"\"value\" must be of type object","path":[],"type":"object.base"}],"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\kubectx"} debug: [KUBECONFIG-SYNC]: File now has 0 entries {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\kubectx"} debug: [KUBECONFIG-SYNC]: Finished computing diff {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\kubectx"} debug: [KUBECONFIG-SYNC]: File now has 2 entries {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\config"} debug: [KUBECONFIG-SYNC]: Added new cluster from sync {"contextName":"dev-staff@dev-app.myapp","filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\config"} debug: [KUBECONFIG-SYNC]: Added new cluster from sync {"contextName":"prod-staff@prod-app.myapp","filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\config"} debug: [KUBECONFIG-SYNC]: Finished computing diff {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube\\config"} info: [CREATE-ELECTRON-WINDOW]: Window "first-application-window" loaded info: [CLUSTER]: activate {"accessible":false,"disconnected":true,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false} info: [CLUSTER]: bind events {"accessible":false,"disconnected":true,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false} info: Starting connection ... {"meta":{"accessible":false,"disconnected":true,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false}} info: [CLUSTER]: reconnect {"accessible":false,"disconnected":true,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false} info: Authentication proxy started {"meta":{"accessible":false,"disconnected":true,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false}} info: [KUBE-AUTH-PROXY]: found port=55572 debug: [CLUSTER-MANAGER]: updating catalog from cluster store info: Refreshing connection status ... {"meta":{"accessible":false,"disconnected":false,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false}} error: error: unknown command "oidc-login" for "kubectl" {"meta":{"accessible":false,"disconnected":false,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false}} error: E0802 18:44:50.162301 41548 proxy_server.go:147] Error while proxying request: getting credentials: exec: executable kubectl failed with exit code 1 {"meta":{"accessible":false,"disconnected":false,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false}} error: [CLUSTER]: Failed to connect to "dev-staff@dev-app.myapp": Error: Failed to get /version for clusterId=3eec37498ca23e245b77ddf126cbf918: Internal Server Error error: Failed to get /version for clusterId=3eec37498ca23e245b77ddf126cbf918: Internal Server Error {"meta":{"accessible":false,"disconnected":false,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false}} debug: [CLUSTER]: already disconnected {"id":"acedf1886811f2a3b20bc8d1e61e5e99"} debug: [CLUSTER]: already disconnected {"id":"ba08b0439431ff5324bf28fc3f140804"} info: [CLUSTER]: disconnecting {"id":"3eec37498ca23e245b77ddf126cbf918"} debug: [KUBE-AUTH]: stopping local proxy {"accessible":false,"disconnected":false,"id":"3eec37498ca23e245b77ddf126cbf918","name":"dev-staff@dev-app.myapp","online":false,"ready":false} info: [CLUSTER]: disconnected {"id":"3eec37498ca23e245b77ddf126cbf918"} debug: [CLUSTER-MANAGER]: updating catalog from cluster store debug: [CLUSTER]: already disconnected {"id":"942312d567440821efc149205de29b45"} info: [LENS-PROXY]: Closing server info: Quitting application ... info: [SHELL-SESSIONS]: Killing all remaining shell sessions info: [KUBECONFIG-SYNC]: stopping requested syncs info: [KUBECONFIG-SYNC]: stopping sync of file/folder {"filePath":"C:\\Users\\radon\\AppData\\Roaming\\Lens\\kubeconfigs"} debug: [KUBECONFIG-SYNC]: 1 files/folders watched {"files":["\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"]} info: [KUBECONFIG-SYNC]: stopping sync of file/folder {"filePath":"\\\\wsl.localhost\\Ubuntu-22.04\\home\\radon\\.kube"} debug: [KUBECONFIG-SYNC]: 0 files/folders watched {"files":[]} info: [EXTENSION-DISCOVERY] stopping the watch for extensions info: [EXTENSION]: disabled @lensapp/cloud-provider-sync-extension@0.2.0 info: [LENS-DESKTOP-KUBE] deactivated debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:enabled","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:start","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:stop","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:reset","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:delete","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:installDockerContext","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:uninstallDockerContext","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:download:pause","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:download:resume","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:download:cancel","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:create","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:update","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:profiles:get","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:getDockerInstallStatus","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"k0s:versions:get","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"extension:enable","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:cluster:active","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:cluster:isLdkClusterPath","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:cluster:getId","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vm:os:compatibility","extension":{"name":"@lensapp/lens-desktop-kube-lens-extension","version":"0.28.1"}} info: [EXTENSION]: disabled @lensapp/lens-desktop-kube-lens-extension@0.28.1 info: [EXTENSION]: disabled @lensapp/lens-license-extension@0.14.0 info: [LENS-SPACES-EXTENSION]: 02/08/2023, 18:44:58 Lens Spaces Extension deactivated debug: [IPC-RENDERER]: removing extension listener {"channel":"disconnectClusterEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension listener {"channel":"deleteOneSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"forceRefreshToken","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"disconnectProxiedClustersEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"resetSpaceSyncerEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"stopTokenRefresherEvent","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"getSpaceSyncerSpaces","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension listener {"channel":"loadRemoteSpacesClusters","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension listener {"channel":"createOneSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension listener {"channel":"leaveOneSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} debug: [IPC-RENDERER]: removing extension listener {"channel":"selectSpace","extension":{"name":"@lensapp/lenscloud-lens-extension","version":"1.32.2"}} info: [EXTENSION]: disabled @lensapp/lenscloud-lens-extension@1.32.2 info: [LENS-SECURITY] deactivated debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:db:import","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:settings:open","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"clustersecurity:settings:open","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:db:export","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"csv:export","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:db:info","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:clear","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:scan:image","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:scan:storage","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"vulnerabilities:scan:enabled","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"image:manifest","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"image:tag","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"image:manifest-list","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"image:history","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} debug: [IPC-RENDERER]: removing extension handler {"channel":"image:vulnerabilities","extension":{"name":"@lensapp/oci-image-lens-extension","version":"0.29.2"}} info: [EXTENSION]: disabled @lensapp/oci-image-lens-extension@0.29.2 debug: [IPC-RENDERER]: removing extension handler {"channel":"logs:export","extension":{"name":"@lensapp/support-lens-extension","version":"0.12.0"}} info: [EXTENSION]: disabled @lensapp/support-lens-extension@0.12.0 info: [EXTENSION]: disabled @lensapp/survey-lens-extension@0.6.0 info: [EXTENSION]: disabled @lensapp/telemetry-lens-extension@0.8.0 debug: [IPC-RENDERER]: removing extension handler {"channel":"clustersecurity:settings:open","extension":{"name":"@lensapp/tour-lens-extension","version":"1.7.1"}} info: [EXTENSION]: disabled @lensapp/tour-lens-extension@1.7.1 ```

Kubeconfig: Quite often the problems are caused by malformed kubeconfig which the application tries to load. Please share your kubeconfig, remember to remove any secret and sensitive information.

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: ****SECRET****
    server: https://****SECRET****
  name: dev-app.myapp
- cluster:
    certificate-authority-data: ****SECRET****
    server: ****SECRET****
  name: prod-app.myapp
contexts:
- context:
    cluster: dev-app.myapp
    user: dev-staff
  name: dev-staff@dev-app.myapp
- context:
    cluster: prod-app.myapp
    user: prod-staff
  name: prod-staff@prod-app.myapp
current-context: prod-staff@prod-app.myapp
kind: Config
preferences: {}
users:
- name: dev-staff
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=****SECRET****
      - --oidc-client-id=****SECRET****
      - --oidc-client-secret=****SECRET****
      command: kubectl
      env: null
      interactiveMode: IfAvailable
      provideClusterInfo: false
- name: prod-staff
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=****SECRET****
      - --oidc-client-id=****SECRET****
      - --oidc-client-secret=****SECRET****
      command: kubectl
      env: null
      interactiveMode: IfAvailable
      provideClusterInfo: false

Additional context Add any other context about the problem here.

caylorme commented 11 months ago

I'd also like to be able to use the native windows Lens installation to access clusters requiring a binary executed within WSL and residing on the WSL filesystem.

Although I do understand that the settings configured in this issue do not relate to the execution environment of kubectl, it would be nice to have a seamless integration.

As a side note, the current "workaround" or "solution" is to run Lens inside of WSL.

atonbdf commented 2 months ago

I had the same problem... The config in WSL does not work when passed to Lens in Windows. Here it worked when I setup kubectl on Windows directly, without using WSL. This is an annoying bug