# Lens Terminal Fails to exec while kubectl works with OS terminal

**URL:** https://forums.k8slens.dev/t/lens-terminal-fails-to-exec-while-kubectl-works-with-os-terminal/606
**Category:** Lens Support & Troubleshooting
**Tags:** lens-desktop
**Created:** [June 28, 2023, 11:18am UTC](https://forums.k8slens.dev/t/lens-terminal-fails-to-exec-while-kubectl-works-with-os-terminal/606 "2023-06-28T11:18:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vikram.arsid27](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/v/e47774/32.png) [@vikram.arsid27](https://forums.k8slens.dev/u/vikram.arsid27)
#### Post date: [June 28, 2023, 11:18am UTC](https://forums.k8slens.dev/t/lens-terminal-fails-to-exec-while-kubectl-works-with-os-terminal/606/1 "2023-06-28T11:18:02Z")

</div>

I am seeing an issue with Lens terminal where it cannot exec into pod.

CMD:

```auto
exec kubectl exec -i -t -n NAMESPACE POD-NAME -c CONT_NAME -- sh -c "clear; (bash || ash || sh)"

```

above command works in shell outside Lens terminal but fails with below error in Lens Terminal.

Error in Terminal

```auto
error: unable to upgrade connection: error dialing backend: dial tcp x.x.x.x:443: connect: connection timed out
Terminal will auto-close in 15 seconds ...

```

Debug Log:

```auto
E0628 07:06:09.072867 241041 proxy_server.go:147] Error while proxying request: error dialing backend: dial tcp x.x.x.x:443: connect: connection timed out
 +18s

```

Here, I am trying to connect to GKE cluster via proxy. I have set the proxy-url in kube config. Lens can connect to cluster successfully and list all workloads, I am having issue with Lens Terminal pod exec only, pod Logs also works fine.

I have tried to set HTTPS\_PROXY env vars but still its same.

Lens Version: v2023.5.310801-latest (5/31/2023)  
Kubernetes Version: 1.24.13-gke.2500

Thanks you for your support here. Please let me know if there is any workaround here. Thank you!

---

<div class="post-metadata">

### Author: ![jehrismann](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/jehrismann/32/398_2.png) [@jehrismann](https://forums.k8slens.dev/u/jehrismann)
#### Post date: [July 5, 2023, 6:57pm UTC](https://forums.k8slens.dev/t/lens-terminal-fails-to-exec-while-kubectl-works-with-os-terminal/606/2 "2023-07-05T18:57:47Z")

</div>

This might be the same as [Can't open a shell on a pod from behind a corporate proxy · Issue #6687 · lensapp/lens · GitHub](https://github.com/lensapp/lens/issues/6687). No timeline for a fix yet though…
