I can’t connect to the container via LENS Desktop

Hi everyone!

I have the following problem:

  1. I have Rancher and use it to get the Kubernetes configuration (as a file);

  2. The next step is this Kubernetes config file, I put it in the standard path in ~/.kube/… and then use it when connecting to LENS (or connecting via kubectl);

  3. Then I go to LENS, specify the path for the Kubernetes Clusters configuration files and select the config file I need to work, after which, when I go into it, I can do any manipulations except entering the container, I get the following error:

> exec kubectl exec -i -t -n testdomain-com testdomain-com-7dff6f4859-smd9j -c wordpress -- sh -c "clear; (bash || ash || sh)"
error: unable to upgrade connection: error dialing backend: remote error: tls: handshake failure
  1. At the same time, if I execute a command from the terminal, I can log into the container, I can’t log in only through LENS, an example of a login command through the terminal:
> kubectl --kubeconfig /home/user/.kube/test-k8s-cluster.yaml exec -i -t -n testdomain-com testdomain-com-7dff6f4859-smd9j -c wordpress --sh -c "clear; (bash | 
|ash||sh)"
bash-5.1# 
bash-5.1# ls -lah
total 280K   
drwxr-xr-x 7 www-data www-data 4.0K Aug 16 16:44 .
drwxr-xr-x 1 root root 4.0K Jun 23 2023 ..
drwxrwxrwx 6 www-data www-data 4.0K Jul 16 16:27 .git
-rw-rw-rw- 1 www-data www-data 647 Jan 26 2024 .gitignore
...

It turns out that through LENS, I can’t access the container, but through the terminal and kubectl, I can log in without problems.

How can I fix the problem with logging into the container via LENS?

If any other details are needed, I will definitely share.

I hope you can help me.

Hello bolshakov.production,

Thank you for reaching out to Lens support!

Could you provide us with the Logs, please? To do it you can click “Export support logs”, this button will appear when you click on the support button at the bottom of Lens.

We are waiting for you to reply.

Best Regards,
Tikhon Kudinov
Lens Support Engineer
Mirantis, Inc

Hello bolshakov.production,

Can you open a support ticket on Zendesk? It will be more convenient for us and for you, if you will need to share some information.

We are waiting for you to reply.

Best Regards,
Tikhon Kudinov
Lens Support Engineer
Mirantis, Inc

Hi, tkudinov!

These logs contain information from my K8s Cluster which is confidential information, I can’t send you the full log, can you tell me so that I can send you a specific part of the log for this error, what should it look like?

Now I’ll try to track down this error myself, but I’m not sure what will come out in these logs, because, if I copy the name of this error and look for it in these uploaded logs, then I don’t see it there.

What options do we have?

Thanks for your reaction.

How can I do this, is there any link?

@tkudinov I was able to correlate the error in the LENS terminal with the logs from the file (lens-main.log) in time and thereby tracked our log:

error: 2024/09/03 12:02:54 httputil: ReverseProxy read error during body copy: stream error: stream ID 2531; INTERNAL_ERROR; received from peer
 {"meta":{"accessible":true,"disconnected":false,"id":"b92d10f8ddb09048d9fe01dfc5e55209","name":"test-k8s-cluster","online":true,"ready":true}}

Is this enough?

I couldn’t find any other information.

@tkudinov Hi! Can you tell me if there is any news on this problem?

Hi, can you give us some details of the cluster? What cluster distribution & version is it? Is it RKE? Anything special in the kubeconfig related to HTTP certificates? This might be due to some conflict/bug with Lens internal proxy.

@phorsmalahti Hi!

I have 24 different K8s Clusters in Rancher (all of them were added to Rancher as an existence, not one K8s Clusters was created through Rancher), for example, there are AWS (EKS), DigitaOcean (Terraform), K3s and other types of installations. Everywhere different versions of Kubernetes and distributions are used. But everyone has the same problem, which I showed above in this topic.

Kubeconfig is the same everywhere for 24 K8s Clusters, it differs only in the name and user:

apiVersion: v1
kind: Config
clusters:
- name: "test-k8s-cluster"
  cluster:
    server: "https://rancher.my_domain/k8s/clusters/***"

users:
- name: "test-k8s-cluster"
  user:
    token: "kubeconfig-user-***:***"

contexts:
- name: "test-k8s-cluster"
  context:
    user: "test-k8s-cluster"
    cluster: "test-k8s-cluster"

current-context: "test-k8s-cluster"

If necessary, I will give more details. Although, I don’t see the point in writing for each of the 24 K8s Clusters, they are all different and they all have the same problem.

I would like to try installing an older version of LENS, the May or June release, is this possible?

Thank you for your clarification, I hope we can resolve this issue or come to something concrete.