# Launch kubectl closed code 1006

**URL:** <https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933>\
**Category:** SUSE Rancher Prime\
**Created:** [April 12, 2019, 10:27am UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933 "2019-04-12T10:27:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cudiunal](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@cudiunal](https://forums.suse.com/u/cudiunal)\
**Post date:** [April 12, 2019, 10:27am UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/1 "2019-04-12T10:27:30Z")

</div>

Hi,

I have a rancher node and launched kubernetes with 3 nodes (1 master, 2 workers). However, in rancher, Launh Kubectl gives an error Closed Code 1006

Any suggestions?

Thanks

---

<div class="post-metadata">

**Author:** ![quasimotoca](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/quasimotoca/32/4314_2.png) [@quasimotoca](https://forums.suse.com/u/quasimotoca)\
**Post date:** [April 26, 2019, 3:17pm UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/2 "2019-04-26T15:17:37Z")

</div>

Same problem here - all of a sudden…

---

<div class="post-metadata">

**Author:** ![caevv](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/caevv/32/5018_2.png) [@caevv](https://forums.suse.com/u/caevv)\
**Post date:** [April 30, 2019, 10:31am UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/3 "2019-04-30T10:31:00Z")

</div>

Same here but different code:  
`Closed Code: 1015`

---

<div class="post-metadata">

**Author:** ![Manfred\_Gnaedig](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/manfred_gnaedig/32/5106_2.png) [@Manfred\_Gnaedig](https://forums.suse.com/u/Manfred_Gnaedig)\
**Post date:** [May 1, 2019, 9:05pm UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/4 "2019-05-01T21:05:16Z")

</div>

I have the same problem with Rancher 2.2.2

root@server-01:~# kubectl get po -n grafana-mm01  
NAME READY STATUS RESTARTS AGE  
grafana-01-dccff9fbf-vv6zp 1/1 Running 1 42m  
root@server-01:~# kubectl logs grafana-01-dccff9fbf-vv6zp  
Error from server (NotFound): pods “grafana-01-dccff9fbf-vv6zp” not found

Very strange…  
root@server-01:~# kubectl exec grafana-01-dccff9fbf-vv6zp -n grafana-mm01 – /bin/bash  
error: unable to upgrade connection: pod does not exist

root@server-01:~# kubectl -v=7 exec grafana-01-dccff9fbf-vv6zp -n grafana-mm01 – /bin/bash  
I0501 23:34:38.780428 5311 loader.go:359] Config loaded from file /root/.kube/config  
I0501 23:34:38.781943 5311 round\_trippers.go:416] GET [https://192.168.178.111:6443/api/v1/namespaces/grafana-mm01/pods/grafana-01-dccff9fbf-vv6zp](https://192.168.178.111:6443/api/v1/namespaces/grafana-mm01/pods/grafana-01-dccff9fbf-vv6zp)  
I0501 23:34:38.782344 5311 round\_trippers.go:423] Request Headers:  
I0501 23:34:38.782585 5311 round\_trippers.go:426] Accept: application/json, _/_  
I0501 23:34:38.782791 5311 round\_trippers.go:426] User-Agent: kubectl/v1.14.1 (linux/amd64) kubernetes/b739410  
I0501 23:34:38.792236 5311 round\_trippers.go:441] Response Status: 200 OK in 9 milliseconds  
I0501 23:34:38.799915 5311 round\_trippers.go:416] POST [https://192.168.178.111:6443/api/v1/namespaces/grafana-mm01/pods/grafana-01-dccff9fbf-vv6zp/exec?command=%2Fbin%2Fbash&container=grafana&stderr=true&stdout=true](https://192.168.178.111:6443/api/v1/namespaces/grafana-mm01/pods/grafana-01-dccff9fbf-vv6zp/exec?command=%2Fbin%2Fbash&container=grafana&stderr=true&stdout=true)  
I0501 23:34:38.802768 5311 round\_trippers.go:423] Request Headers:  
I0501 23:34:38.803426 5311 round\_trippers.go:426] X-Stream-Protocol-Version: [v4.channel.k8s.io](http://v4.channel.k8s.io)  
I0501 23:34:38.803684 5311 round\_trippers.go:426] X-Stream-Protocol-Version: [v3.channel.k8s.io](http://v3.channel.k8s.io)  
I0501 23:34:38.803960 5311 round\_trippers.go:426] X-Stream-Protocol-Version: [v2.channel.k8s.io](http://v2.channel.k8s.io)  
I0501 23:34:38.804233 5311 round\_trippers.go:426] X-Stream-Protocol-Version: [channel.k8s.io](http://channel.k8s.io)  
I0501 23:34:38.804480 5311 round\_trippers.go:426] User-Agent: kubectl/v1.14.1 (linux/amd64) kubernetes/b739410  
I0501 23:34:38.822631 5311 round\_trippers.go:441] Response Status: 404 Not Found in 17 milliseconds  
F0501 23:34:38.823119 5311 helpers.go:114] error: unable to upgrade connection: pod does not exist  
root@server-01:~#

Also via the Rancher UI no Logs and no Shell…

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [May 1, 2019, 11:42pm UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/5 "2019-05-01T23:42:16Z")

</div>

1006 just means the connection was closed without sending a close frame/message first (which is the normal way of closing the connection).

So the cause can be anything, and is probably different for each of you, but likely involve something like a proxy/balancer/enterprise-tls-man-in-the-middle device that does not know how to speak websockets properly or issues with the TLS setup (1015 means that the cert verification failed).

---

<div class="post-metadata">

**Author:** ![Manfred\_Gnaedig](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/manfred_gnaedig/32/5106_2.png) [@Manfred\_Gnaedig](https://forums.suse.com/u/Manfred_Gnaedig)\
**Post date:** [May 2, 2019, 12:58pm UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/6 "2019-05-02T12:58:04Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/f/f9ac3647422e3d13cfb3257785c791c65188c480.png)

I have done now a new installation of Rancher 2.2.2.  
I can use kubectl via Rancher UI.  
I can list Pods  
BUT:  
I can’t view Logs from the Pods  
I can’t ssh into the Pods

SEE Attached Screenshot.

Any Idea how to troubleshoot this behavior?  
Without Pod Logs and SSH Login to the Pods I cant use this installation…

Thanks in advance

---

<div class="post-metadata">

**Author:** ![superseb](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/superseb/32/2424_2.png) [@superseb](https://forums.suse.com/u/superseb)\
**Post date:** [May 2, 2019, 4:44pm UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/7 "2019-05-02T16:44:12Z")

</div>

Can you try `kubectl -n kube-system logs metrics-server-58bd5dd9d7-2mt7w` for the logs and `kubectl -n kube-system exec -it metrics-server-58bd5dd9d7-2mt7w -- /bin/sh` for exec (which is not really SSH)?

First command is using `kubectl get logs` where logs is not a k8s resource and it is also not specifying the namespace it is in, `kubectl logs` and adding `-n kube-system` should resolve that.

Second one, is trying to exec into a pod of a job which is Completed (nothing to exec into) and missing the namespace as well. Using a Running pod and specifying the namespace should resolve that.

---

<div class="post-metadata">

**Author:** ![boristimp](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/boristimp/32/5331_2.png) [@boristimp](https://forums.suse.com/u/boristimp)\
**Post date:** [May 13, 2019, 10:01am UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/8 "2019-05-13T10:01:00Z")

</div>

Same problem here with version v2.2.2, tried two different setups, one is working, the other one (production setup) not:

Cluster 3 nodes (one nodepool): Launch Kubectl from UI **is** working  
Cluster 3 nodes (2 nodepools, separate etcd, worker): Launch Kubectl from UI **not** working, indicating “Code 1006” in the UI

Note: my rancher container is living behind a traefik proxy with LE enabled.

---

<div class="post-metadata">

**Author:** ![eqx-fschottz](https://avatars.discourse-cdn.com/v4/letter/e/b5e925/32.png) [@eqx-fschottz](https://forums.suse.com/u/eqx-fschottz)\
**Post date:** [December 9, 2019, 1:40pm UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/9 "2019-12-09T13:40:14Z")

</div>

Hey folks!

In my case it was the firewall.

Check yours.

---

<div class="post-metadata">

**Author:** ![sdevang](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sdevang/32/6387_2.png) [@sdevang](https://forums.suse.com/u/sdevang)\
**Post date:** [May 18, 2020, 2:15am UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/10 "2020-05-18T02:15:36Z")

</div>

I had the same issue and I managed to fix it by increasing load balancer’s timeout to 3600. I hope this might help someone else in future too.

---

<div class="post-metadata">

**Author:** ![everton1010](https://avatars.discourse-cdn.com/v4/letter/e/8baadc/32.png) [@everton1010](https://forums.suse.com/u/everton1010)\
**Post date:** [September 21, 2021, 2:50pm UTC](https://forums.suse.com/t/launch-kubectl-closed-code-1006/13933/11 "2021-09-21T14:50:47Z")

</div>

> [@superseb](#):
>
> mando é usar `kubectl get logs` onde logs não é um recurso k8s e também não especifica o namespace em que está, `kubectl logs` e adicionar `-n kube-system` deve resolver isso.
> 
> Em segundo lugar, está tentando executar em um pod de um trabalho que está concluído (nada para executar em) e sem o namespace também. Usar um pod em execução e especificar o namespace

Qual alteração realizou no firewall para solucionar?
