# Unable run kubectl exec

**URL:** <https://forums.suse.com/t/unable-run-kubectl-exec/41244>\
**Category:** SUSE Rancher Prime\
**Created:** [August 2, 2023, 5:10am UTC](https://forums.suse.com/t/unable-run-kubectl-exec/41244 "2023-08-02T05:10:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jitansahu](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jitansahu](https://forums.suse.com/u/jitansahu)\
**Post date:** [August 2, 2023, 5:11am UTC](https://forums.suse.com/t/unable-run-kubectl-exec/41244/1 "2023-08-02T05:11:00Z")

</div>

unable run kubectl exec & port forwarding command after upgrading to rancher 2.7.3

$ kubectl exec -it -n cip-only nginx-795b5b8f9-mtqff – /bin/bash  
Error from server:

---

<div class="post-metadata">

**Author:** ![mrcaldo](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@mrcaldo](https://forums.suse.com/u/mrcaldo)\
**Post date:** [August 3, 2023, 10:12am UTC](https://forums.suse.com/t/unable-run-kubectl-exec/41244/2 "2023-08-03T10:12:18Z")

</div>

more info about the error might be helpful.  
Do you know the free tool k9s? With it you can open a shell for an existing pod and do port-forwarding very easily.  
Have a look at

> **[K9s - Manage Your Kubernetes Clusters In Style](https://k9scli.io/)**
>
> K9s provides a terminal UI to interact with your Kubernetes clusters. The aim of this project is to make it easier to navigate, observe and manage your Kuber...

---

<div class="post-metadata">

**Author:** ![jitansahu](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jitansahu](https://forums.suse.com/u/jitansahu)\
**Post date:** [August 7, 2023, 6:52am UTC](https://forums.suse.com/t/unable-run-kubectl-exec/41244/3 "2023-08-07T06:52:42Z")

</div>

Somehow not able to put entire error msg. but following i am getting at end

ers.go:246] server response object: [{  
“metadata”: {}  
}]

---

<div class="post-metadata">

**Author:** ![mrcaldo](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@mrcaldo](https://forums.suse.com/u/mrcaldo)\
**Post date:** [August 9, 2023, 6:32am UTC](https://forums.suse.com/t/unable-run-kubectl-exec/41244/4 "2023-08-09T06:32:58Z")

</div>

can you open a shell from within the Rancher-UI with the “execute shell” command at the pod (…)?

---

<div class="post-metadata">

**Author:** ![jitansahu](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jitansahu](https://forums.suse.com/u/jitansahu)\
**Post date:** [August 9, 2023, 7:04am UTC](https://forums.suse.com/t/unable-run-kubectl-exec/41244/5 "2023-08-09T07:04:07Z")

</div>

i can get shell access from rancher ui.  
not able to run kubectl exec & kubectl port-forwarding command from cli

---

<div class="post-metadata">

**Author:** ![Andrey\_Ivanov](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/andrey_ivanov/32/8631_2.png) [@Andrey\_Ivanov](https://forums.suse.com/u/Andrey_Ivanov)\
**Post date:** [August 16, 2023, 6:26am UTC](https://forums.suse.com/t/unable-run-kubectl-exec/41244/6 "2023-08-16T06:26:43Z")

</div>

Hi,

I had the same message before enable websockets on proxy (load balancer) on which we use to access port 6443 of rancher. Also we have to enable spdy/3.1
