lensapp / lens

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

App crashes without any apparent reason #4546

Closed barddes closed 2 years ago

barddes commented 2 years ago

Describe the bug When connecting to the cluster, the app chash showing two stacks on screen: component stack and error stack. While on this state, I cannot navigate the cluster as the stacktrace covers the whole screen. I also tried to connect to another cluster. It connected successfully without any issue.

Deleting ~/.k8slens and ~/.config/OpenLens temporally fix the problem.

To Reproduce I have encountered this issue a few times by now, but I'm still unable to reproduce it flawlessly.

The steps did when the error happened for the first time:

Expected behavior Navigate through the cluster, check pods and logs, etc.

Screenshots Unafortunally I've lost the screenshot, if/when it happen again I'll upload it

Environment (please complete the following information):

Logs: When you run the application executable from command line you will see some logging output. Please paste them here:

info:    ┏ [CLUSTER]: reconnect +0ms
info:    ┃ [1] {
info:    ┃ [2]   id: 'CLUSTER_ID',
info:    ┃ [3]   name: 'CLUSTER_NAME',
info:    ┃ [4]   ready: false,
info:    ┃ [5]   online: false,
info:    ┃ [6]   accessible: false,
info:    ┃ [7]   disconnected: true
info:    ┗ [8] }
error:   ▪ Detected invalid bundle binary, returning ... +2s

I compared the error logs with the logs when I've already deleted the mentioned folders (fixed the problem), they are the same :(

Kubeconfig:

apiVersion: v1
kind: Config
preferences: {}

clusters:
- name: "cluster"
  cluster:
    server: https://CLUSTER_URL
...other clusters...
contexts:
- name: "cluster"
  context:
    user: "cluster"
    cluster: "cluster"
...other contexts...
users:
- name: "cluster"
  user:
    token: REDACTED
...other users...
current-context: cluster

Additional context RKE Cluster

Component stack:
    at wrappedComponent (http://xxx.localhost:39831/build/OpenLens.js:10557:16)
    at div
    at Logs (http://xxx.localhost:39831/build/chunks/5.js:7285:9)
    at div
    at div
    at Dock (http://xxx.localhost:39831/build/chunks/5.js:7717:9)
    at div
    at div
    at MainLayout (http://xxx.localhost:39831/build/OpenLens.js:286596:9)
    at ErrorBoundary (http://xxx.localhost:39831/build/OpenLens.js:237949:9)
    at Router (http://xxx.localhost:39831/build/OpenLens.js:79054:30)
    at ClusterFrame (http://xxx.localhost:39831/build/chunks/5.js:7946:9)
    at ThemeProvider (http://xxx.localhost:39831/build/OpenLens.js:609758:24)

Error stack:
TypeError: Cannot create a KubeObject from undefined
    at new KubeObject (http://xxx.localhost:39831/build/OpenLens.js:32750:19)
    at new WorkloadKubeObject (http://xxx.localhost:39831/build/OpenLens.js:124953:1)
    at new Pod (http://xxx.localhost:39831/build/OpenLens.js:154508:9)
    at http://xxx.localhost:39831/build/chunks/5.js:7217:17
    at http://xxx.localhost:39831/build/OpenLens.js:10557:49
    at http://xxx.localhost:39831/build/OpenLens.js:10521:25
    at trackDerivedFunction (http://xxx.localhost:39831/build/OpenLens.js:3120:18)
    at Reaction.track (http://xxx.localhost:39831/build/OpenLens.js:3649:18)
    at useObserver (http://xxx.localhost:39831/build/OpenLens.js:10519:14)
    at wrappedComponent (http://xxx.localhost:39831/build/OpenLens.js:10557:16)
    at Ch (http://xxx.localhost:39831/build/OpenLens.js:556346:137)
    at li (http://xxx.localhost:39831/build/OpenLens.js:556369:154)
    at ki (http://xxx.localhost:39831/build/OpenLens.js:556367:169)
    at ii (http://xxx.localhost:39831/build/OpenLens.js:556366:178)
    at ck (http://xxx.localhost:39831/build/OpenLens.js:556463:126)
    at bk (http://xxx.localhost:39831/build/OpenLens.js:556439:347)
```-
barddes commented 2 years ago

Probably my issue is related to #4506 and #4442.

redydeepu commented 2 years ago

even i have the same issue

Nokel81 commented 2 years ago

Yes, thanks for the report. But it is indeed a duplicate of those. You can fix this issue temporarily by deleting ~/.config/Lens/lens-local-storage/<CLUSTER-ID>.json