Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
saschavusatjuk opened this issue Oct 17, 2024 · 6 comments
Assignees
Labels
defect Suspected defect such as a bug or regression

Comments

@saschavusatjuk
Copy link

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 saschavusatjuk added the defect Suspected defect such as a bug or regression label Oct 17, 2024
@saschavusatjuk
Copy link
Author

saschavusatjuk commented Oct 22, 2024

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

@piotrpio piotrpio self-assigned this Oct 30, 2024
@piotrpio
Copy link
Contributor

Hello @saschavusatjuk, thanks for creating the issue. Could you please provide the stack trace of the panic? Also, how are you authenticating (creds or user/password)?

@mtmk
Copy link
Contributor

mtmk commented Oct 31, 2024

@saschavusatjuk are you seeing this against a single nats-server?

I'm seeing the same error when running a single nats server I'm guessing because the meta (MetaClusterInfo) isn't there for jetstream as in sm.Stats.JetStream.Meta.Pending

metrics.newCounterMetric(sc.descs.JetstreamAPIPending, float64(sm.Stats.JetStream.Meta.Pending), lblServerID)

@ripienaar
Copy link
Collaborator

Probsbly fixed by #220

@saschavusatjuk
Copy link
Author

It was a problem with surveyor running without cluster in version 0.7.0. Here is my comment in the nats-io/k8s repository.

@mtmk
Copy link
Contributor

mtmk commented Oct 31, 2024

Probsbly fixed by #220

this fixed it for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

4 participants