lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.55k stars 1.47k forks source link

Session expires after first 30 minutes or so after opening the app #2574

Open raswinraaj opened 3 years ago

raswinraaj commented 3 years ago

Describe the bug Session expires after first 30 minutes or so after opening the app

To Reproduce Steps to reproduce the behavior:

  1. Open Lens App
  2. Connect to a cluster
  3. Check logs
  4. Keep the app open for 30 minutes or so, the session seems to expire.

Expected behavior Opening any pod log should happen successfully. But on clicking of the pod log button, nothing opens

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Logs: No logs available

Kubeconfig: Quite often the problems are caused by malformed kubeconfig which the application tries to load. Please share your kubeconfig, remember to remove any secret and sensitive information.

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data:  **censored**
    server: https://**censored**-d8f47b9d.hcp.eastus.azmk8s.io:443
  name: aks-**censored**
contexts:
- context:
    cluster: aks-**censored**
    user: clusterUser_**censored**_aks-**censored**
  name: aks-**censored**
current-context: aks-**censored**
kind: Config
preferences: {}
users:
- name: clusterUser_**censored**_aks-**censored**
  user:
    client-certificate-data: **censored**
    client-key-data: **censored**
    token: **censored**

Additional context Add any other context about the problem here.

Nokel81 commented 3 years ago

Is this related to #2547 ?

What do you mean by "session"? Lens doesn't have session.

raswinraaj commented 3 years ago

Yes, I know it doesnt have a session. But what I mean is, after few minutes of inactivity, we do not have the cluster information like new pods, new nodes data updated, the pod logs do not open, etc . They start working only after we restart the Lens app itself. This is something which has been a case for earlier versions of Lens app as well. I understand this might be a Windows specific bug. I was not sure how to capture/share a log for this . Please suggest if any.

raswinraaj commented 3 years ago

No. It doesn't have anything to do with #2547. For a lack of a better word, I have used the term 'session'

Nokel81 commented 3 years ago

You can get logs by following https://docs.k8slens.dev/v4.2.2/faq/#where-can-i-find-application-logs

Please also run in DEBUG mode if possible.

This sounds like our kubectl watch or kubectl proxy are closed on the windows side...

raswinraaj commented 3 years ago

Yes. That's exacy right. Kubectl watch doesn't work properly on the lens app. But it works fine when I run the command directly on the command prompt

Nokel81 commented 3 years ago

Does it work correctly even if you leave it open for 30 minutes?

raswinraaj commented 3 years ago

No it doesn't work even if I am actively working on the same cluster.

Nokel81 commented 3 years ago

Thanks for the information, any ideas @ixrock ?

Nokel81 commented 3 years ago

@raswinraaj Are you able to provide any logs? What about a short video showing what happens when you click on the pod logs button?

raswinraaj commented 3 years ago

https://user-images.githubusercontent.com/50330414/116232124-52fa1500-a777-11eb-8d02-33160962f79b.mp4 If you have a look at the above video, auditing service shows 3 pods in lens UI with 1 pod with CrashLoopError and the other 2 pods are newer ones. But if you look in the command prompt where I have run kubectl get pods, you can see that there are actually only 2 pods running at that point of time. Here the crashed pod even though deleted, is still being shown in the Lens UI. Also I have attached the logs. logs.zip