headlamp-k8s / headlamp

A Kubernetes web UI that is fully-featured, user-friendly and extensible
https://headlamp.dev
Apache License 2.0
2.17k stars 152 forks source link

Frontend is breaking in v0.22.0. #1684

Open yolossn opened 8 months ago

yolossn commented 8 months ago

Steps to reproduce:

Looks like it must be related to this commit

joaquimrocha commented 8 months ago

@yolossn can you check with the main branch. Probably not related, but checking if #1666 fixes it is probably worth it still.

illume commented 8 months ago

@yolossn I couldn't reproduce this locally.

Would you mind showing me what (the redacted) localStorage.getItem('notifications') is?

I worked with @vyncent-t on a potential fix in https://github.com/headlamp-k8s/headlamp/pull/1686

yolossn commented 8 months ago

Here is the data

[
  {
    "id": "2e02d825-432c-4640-a6ea-2af96eb815ba",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=2e02d825-432c-4640-a6ea-2af96eb815ba",
    "date": 1706461592000,
    "deleted": false,
    "cluster": "minikube",
    "message": "Back-off restarting failed container kube-controller-manager in pod kube-controller-manager-minikube_kube-system(b3702ceb912504d37098b922ccdcfa41)",
  },
  {
    "id": "746dcfc7-2db7-4a36-85f9-5b4d6e52e9de",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=746dcfc7-2db7-4a36-85f9-5b4d6e52e9de",
    "date": 1706461582000,
    "deleted": false,
    "cluster": "minikube",
    "message": "error determining status: rpc error: code = Unknown desc = Error response from daemon: No such container: 8a32326ea70e5ef6f083829ef6753bdf607a73758fc82de63d8e0a4bd20033f9",
  },
  {
    "id": "adacd33a-c36c-4a5f-b866-a240281c1733",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=adacd33a-c36c-4a5f-b866-a240281c1733",
    "date": 1706461560000,
    "deleted": false,
    "cluster": "minikube",
    "message": "Liveness probe failed: HTTP probe failed with statuscode: 500",
  },
  {
    "id": "cc38d2df-3351-4591-b2cf-f38b52b532cf",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=cc38d2df-3351-4591-b2cf-f38b52b532cf",
    "date": 1706461560000,
    "deleted": false,
    "cluster": "minikube",
    "message": 'Readiness probe failed: Get "https://192.168.49.2:8443/readyz": unexpected EOF',
  },
  {
    "id": "e554d17d-266f-4b10-907e-f394a965e7f9",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=e554d17d-266f-4b10-907e-f394a965e7f9",
    "date": 1706461560000,
    "deleted": false,
    "cluster": "minikube",
    "message": 'Readiness probe failed: Get "https://192.168.49.2:8443/readyz": dial tcp 192.168.49.2:8443: connect: connection refused',
  },
  {
    "id": "dd6d95ad-35e9-49ec-b3f7-9dd1f7ac69fc",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=dd6d95ad-35e9-49ec-b3f7-9dd1f7ac69fc",
    "date": 1706461559000,
    "deleted": false,
    "cluster": "minikube",
    "message": 'Liveness probe failed: Get "http://127.0.0.1:2381/health?exclude=NOSPACE&serializable=true": dial tcp 127.0.0.1:2381: connect: connection refused',
  },
  {
    "id": "c936f03b-d21b-4a02-b344-0209c7170593",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=c936f03b-d21b-4a02-b344-0209c7170593",
    "date": 1706461559000,
    "deleted": false,
    "cluster": "minikube",
    "message": "Readiness probe failed: HTTP probe failed with statuscode: 500",
  },
  {
    "id": "3d7e5479-7207-4502-aed2-45a101857d2c",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=3d7e5479-7207-4502-aed2-45a101857d2c",
    "date": 1706461559000,
    "deleted": false,
    "cluster": "minikube",
    "message": 'Liveness probe failed: Get "https://127.0.0.1:10259/healthz": dial tcp 127.0.0.1:10259: connect: connection refused',
  },
  {
    "id": "c26b40fe-4083-484d-b2fb-604f31397df4",
    "seen": false,
    "url": "/c/minikube/?eventsFilter=c26b40fe-4083-484d-b2fb-604f31397df4",
    "date": 1706428963000,
    "deleted": false,
    "cluster": "minikube",
    "message": "Back-off restarting failed container kube-controller-manager in pod kube-controller-manager-minikube_kube-system(b3702ceb912504d37098b922ccdcfa41)",
  },
]
illume commented 8 months ago

Thanks @yolossn

It seems somewhere there's a bug injecting the wrong data into the notifications storage.

Here's the crashing data from localStorage.getItem('notifications')

'{"4bb31f05-4f4b-4737-943e-9054280076bb":{"id":"4bb31f05-4f4b-4737-943e-9054280076bb","severity":"warning","icon":"exclamation-triangle","title":"Invalid username or password","text":"","traceId":"","timestamp":1692962401217,"showing":false},"60d00c83-91b2-4f77-80de-5a95432c47e4":{"id":"60d00c83-91b2-4f77-80de-5a95432c47e4","severity":"warning","icon":"exclamation-triangle","title":"Invalid username or password","text":"","traceId":"","timestamp":1692962292642,"showing":false}}'

The fix in https://github.com/headlamp-k8s/headlamp/pull/1686 should at least stop this bug crashing things, but we need to still look into how it's inserting the wrong data structure and fix that too.