Nil reference pointer exception when getting queried by Prometheus #2

Closed
opened 2024-04-18 11:05:20 +02:00 by adoralaura · 0 comments
Owner
ts=2024-04-17T15:44:24.258Z caller=main.go:97 level=info msg="Starting ntppool_exporter" version="(version=, branch=, revision=unknown)"
ts=2024-04-17T15:44:24.258Z caller=main.go:98 level=info build_context="(go=go1.22.2, platform=linux/amd64, user=, date=, tags=unknown)"
ts=2024-04-17T15:44:24.258Z caller=tls_config.go:313 level=info msg="Listening on" address=[::]:43609
ts=2024-04-17T15:44:24.258Z caller=tls_config.go:316 level=info msg="TLS is disabled." http2=false address=[::]:43609
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8ab3eb]

goroutine 11 [running]:
golang.adora.codes/ntppool-exporter/collector.Collector.collect({{0xa7f848, 0xc0001965f0}, {{0x0, 0xffff05fabfaa}, 0xc0000aa000}, {0xa7bf40, 0xc000196640}, {{0xa83828, 0xc000180940}}}, 0xc00006d800, ...)
	/var/app/collector/collector.go:80 +0x3cb
golang.adora.codes/ntppool-exporter/collector.Collector.Collect({{0xa7f848, 0xc0001965f0}, {{0x0, 0xffff05fabfaa}, 0xc0000aa000}, {0xa7bf40, 0xc000196640}, {{0xa83828, 0xc000180940}}}, 0xc00006d800)
	/var/app/collector/collector.go:58 +0x219
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
	/go/pkg/mod/github.com/prometheus/client_golang@v1.19.0/prometheus/registry.go:455 +0x105
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather in goroutine 8
	/go/pkg/mod/github.com/prometheus/client_golang@v1.19.0/prometheus/registry.go:466 +0x568
monitoring-ntppool_exporter-1 exited with code 0

affected docker tags:

Issue happens somewhere right after collector/collector.go:56

``` ts=2024-04-17T15:44:24.258Z caller=main.go:97 level=info msg="Starting ntppool_exporter" version="(version=, branch=, revision=unknown)" ts=2024-04-17T15:44:24.258Z caller=main.go:98 level=info build_context="(go=go1.22.2, platform=linux/amd64, user=, date=, tags=unknown)" ts=2024-04-17T15:44:24.258Z caller=tls_config.go:313 level=info msg="Listening on" address=[::]:43609 ts=2024-04-17T15:44:24.258Z caller=tls_config.go:316 level=info msg="TLS is disabled." http2=false address=[::]:43609 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8ab3eb] goroutine 11 [running]: golang.adora.codes/ntppool-exporter/collector.Collector.collect({{0xa7f848, 0xc0001965f0}, {{0x0, 0xffff05fabfaa}, 0xc0000aa000}, {0xa7bf40, 0xc000196640}, {{0xa83828, 0xc000180940}}}, 0xc00006d800, ...) /var/app/collector/collector.go:80 +0x3cb golang.adora.codes/ntppool-exporter/collector.Collector.Collect({{0xa7f848, 0xc0001965f0}, {{0x0, 0xffff05fabfaa}, 0xc0000aa000}, {0xa7bf40, 0xc000196640}, {{0xa83828, 0xc000180940}}}, 0xc00006d800) /var/app/collector/collector.go:58 +0x219 github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1() /go/pkg/mod/github.com/prometheus/client_golang@v1.19.0/prometheus/registry.go:455 +0x105 created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather in goroutine 8 /go/pkg/mod/github.com/prometheus/client_golang@v1.19.0/prometheus/registry.go:466 +0x568 monitoring-ntppool_exporter-1 exited with code 0 ``` affected docker tags: - https://hub.docker.com/layers/lauralani/ntppool-exporter/0.1.0/images/sha256-d570389175636ae2fe4157b37e4a9e31ecb9f4f186cbc04b3cdd93b5f47d3cd0?context=repo - https://hub.docker.com/layers/lauralani/ntppool-exporter/latest/images/sha256-d570389175636ae2fe4157b37e4a9e31ecb9f4f186cbc04b3cdd93b5f47d3cd0?context=repo Issue happens somewhere right after [collector/collector.go:56](https://gitlab.com/adoralaura/ntppool-exporter/-/blob/main/collector/collector.go?ref_type=heads#L56)
adoralaura added this to the 0.2.0 milestone 2024-04-18 11:05:24 +02:00
adoralaura added the
bug
critical
labels 2024-04-18 11:05:32 +02:00
adoralaura self-assigned this 2024-04-18 11:05:36 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: adoralaura/ntppool-exporter#2
No description provided.