lensapp / lens

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

Unable to connect to Pods' shell using lens #5513

Open 18191518054 opened 2 years ago

18191518054 commented 2 years ago

click shell Always present Connecting ... But it doesn't connect

18191518054 commented 2 years ago

Always Connecting ...

Nokel81 commented 2 years ago

Would you be able to provide more information?

18191518054 commented 2 years ago

Snipaste_2022-06-01_16-34-12 Always Connecting ...

Nokel81 commented 2 years ago

Any logs? Either from devtools console or when you quit the application completely and run it from the command line with DEBUG=true?

18191518054 commented 2 years ago
[LENS-SPACES-EXTENSION] Error getSpaceCa(), retrying... Error: Catalog api missing for Space 18191518054
    at e.J.Object.startingDelay [as request] (F:\workspace\Lens\resources\extensions\lenscloud-lens-extension\dist\main.js:9:1136521)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
error:   鈹?[22m [SHELL-SESSION]: failed to open a local shell File not found:  +18s
error:   鈹?[22m [1] Error: File not found:
error:   鈹?[22m [2]     at new WindowsPtyAgent (F:\workspace\Lens\resources\app.asar\node_modules\node-pty\lib\windowsPtyAgent.js:78:36)
error:   鈹?[22m [3]     at new WindowsTerminal (F:\workspace\Lens\resources\app.asar\node_modules\node-pty\lib\windowsTerminal.js:50:24)
error:   鈹?[22m [4]     at Object.spawn (F:\workspace\Lens\resources\app.asar\node_modules\node-pty\lib\index.js:28:12)
error:   鈹?[22m [5]     at l.ensureShellProcess (F:\workspace\Lens\resources\app.asar\static\build\main.js:1:317449)
error:   鈹?[22m [6]     at l.openShellProcess (F:\workspace\Lens\resources\app.asar\static\build\main.js:1:318082)
error:   鈹?[22m [7]     at async l.open (F:\workspace\Lens\resources\app.asar\static\build\main.js:1:307458)
(node:29216) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

This is the software runtime log-----------------------

Nokel81 commented 2 years ago

Thanks for the logs

jason-hobbs commented 2 years ago

I have this problem with with Rancher clusters. When I try to open a shell from a pod on a rancher cluster I get:

Screen Shot 2022-06-13 at 9 36 22 PM

Any non rancher cluster works fine.

Here is the log:

info: [SHELL-SESSION]: shell has exited for 0da0e43917925facc7bd1dc7a4e2d0cd:3a952ed3-4928-4b1d-ae14-0ec768dc8fa3 closed with exitcode=1
info: [CLUSTER]: refresh {"accessible":true,"disconnected":false,"id":"0da0e43917925facc7bd1dc7a4e2d0cd","name":"stage-new","online":true,"ready":true}
info: [SHELL-SESSION]: websocket for 0da0e43917925facc7bd1dc7a4e2d0cd:3a952ed3-4928-4b1d-ae14-0ec768dc8fa3 closed with code=NormalClosure(1000) {"cluster":{"accessible":true,"disconnected":false,"id":"0da0e43917925facc7bd1dc7a4e2d0cd","name":"stage-new","online":true,"ready":true}}
Nokel81 commented 2 years ago

What is your PTYSHELL env variable set to?

Nokel81 commented 2 years ago

Or do you have the shell user preference set?

jason-hobbs commented 2 years ago

It is /bin/zsh

Nokel81 commented 2 years ago

Okay thanks, can you open a new issue for rancher clusters in particular, but given that the OP is on windows and the logs provided what you are seeing is a separate issue.

PavelMikhailouski commented 2 years ago

Changing File > Preferences > Terminal > Terminal Shell Path from sh to wsl (or powershell.exe) solved the issue in my case For some reason sh was the default value for this property even though I use Windows

Nokel81 commented 2 years ago

@PavelMikhailouski Thanks for noticing that

wqfra commented 1 month ago

In Windows 10, you can install WSL using PowerShell with the command wsl --install. After completing the installation, you will need to restart your system, and then WSL should be ready for normal use.