nats-io / nats-surveyor

NATS Monitoring, Simplified.
Apache License 2.0
229 stars 26 forks source link

Surveyor in K8s "panic: runtime error: invalid memory address or nil pointer dereference" #219

Open saschavusatjuk opened 1 week ago

saschavusatjuk commented 1 week ago

What version were you using?

nats-server version: 2.9.8 surveyor: latest clients: not connected atm

What environment was the server running in?

Using microk8s on WSL2 Ubuntu and Windows11 nats-server uses: nats:alpine3.16

Is this defect reproducible?

I was trying to integrate nats-surveyor into k8s without authentication i get: [WARN] Error unmarshalling statz json: unexpected end of JSON input.

Okey in the ReadMe is written use System accounts i enabled SYS as System account with a .conf and also authenticate with the surveyor.

But as soon as I portforward the port and try to curl the metrics i get this error: panic: runtime error: invalid memory address or nil pointer dereference

Nats server runs fine. Surveyor crashes.

Given the capability you are leveraging, describe your expectation?

It should just get me the metrics. I also made it run with docker-compose but in k8s there are problems i did not have with docker-compose.

Given the expectation, what is the defect you are observing?

I think there is problem with nats-surveyor running inside an k8s cluster

saschavusatjuk commented 6 days ago

The error message shows me that the error comes from collector_statz.go around line 920 and 990 @wallyqs @johnweldon @derekcollison @ripienaar