Unable to run commands in Lens terminal

Recently, I noticed that some of my kubernetes contexts, when I access them via Lens, I can’t run kubectl commands in the Lens terminal, but using the same context on the native Mac Terminal, allows me run kubectl commands.

For context, the error I keep getting is 137 [1] killed . This error is usually from K8s pods, so I am not sure why I am getting the error without being connected to any pod. Any ideas would be great. Thanks

1 Like

So I followed the recommendation here: Kubectl is killed in lens desktop terminal, cannot exec to pods, which meant I changed my kubectl binary path, to the very one being used by the terminal. After restarting, the terminal no longer comes up, just stays stuck in “Connecting…”

Yeah, I got the same issue when updated to version 2023.9.290703 on MacOS https://forums.k8slens.dev/t/can-not-exec-to-pod-when-update-2023-9-290703-on-macos/1799/1. They said that the issue was caused by a timeout read config or something to connect to the shell, and they will increase the timeout in the next version.

I am still waiting, you can exec by yourself instead, for ex: k exec pod-name -it -c container-name -n namespace -- /bin/sh

1 Like

Thanks for the info @tannb. I’d keep my eyes peeled for further updates on this

1 Like