charlie-haley / omada_exporter

Prometheus Exporter for TP-Link Omada Controller SDN.
MIT License
87 stars 14 forks source link

exporter started crashing with 0.11.0 #85

Closed yuri1313 closed 10 months ago

yuri1313 commented 10 months ago

hi,

Did an upgrade from 0.10.0 to 0.11.0 (running in k3s, but also tested with podman), and the image fails on startup with this error: Works fine if I rollback the release to 0.10.0.

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x7e106c]

goroutine 1 [running]: github.com/prometheus/client_golang/prometheus.(Registry).Register(0xc0000cc730, {0xa08890?, 0xc00029e690?}) github.com/prometheus/client_golang@v1.9.0/prometheus/registry.go:291 +0x26c github.com/prometheus/client_golang/prometheus.(Registry).MustRegister(0xc0001a0680?, {0xc00029c890?, 0x1, 0x0?}) github.com/prometheus/client_golang@v1.9.0/prometheus/registry.go:402 +0x53 github.com/prometheus/client_golang/prometheus.MustRegister(...) github.com/prometheus/client_golang@v1.9.0/prometheus/registry.go:178 github.com/charlie-haley/omada_exporter/cmd.run(0xc0001b4640?) github.com/charlie-haley/omada_exporter@v0.11.0/cmd/exporter.go:93 +0x27d github.com/urfave/cli/v2.(App).RunContext(0xc000196340, {0xa0a868?, 0xc0000b4000}, {0xc00009e1f0, 0x1, 0x1}) github.com/urfave/cli/v2@v2.3.0/app.go:322 +0x97c github.com/urfave/cli/v2.(App).Run(...) github.com/urfave/cli/v2@v2.3.0/app.go:224 github.com/charlie-haley/omada_exporter/cmd.Run() github.com/charlie-haley/omada_exporter@v0.11.0/cmd/exporter.go:54 +0xb34 main.main() github.com/charlie-haley/omada_exporter@v0.11.0/main.go:8 +0x17

uzzitm commented 10 months ago

i can confirm that version 0.11 gives an error panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x7e106c] goroutine 1 [running]: github.com/prometheus/client_golang/prometheus.(Registry).Register(0xc00006e780, {0xa08890?, 0xc0000b45f0?}) github.com/prometheus/client_golang@v1.9.0/prometheus/registry.go:291 +0x26c github.com/prometheus/client_golang/prometheus.(Registry).MustRegister(0xc0000c6680?, {0xc00009d970?, 0x1, 0x0?}) github.com/prometheus/client_golang@v1.9.0/prometheus/registry.go:402 +0x53 github.com/prometheus/client_golang/prometheus.MustRegister(...) github.com/prometheus/client_golang@v1.9.0/prometheus/registry.go:178 github.com/charlie-haley/omada_exporter/cmd.run(0xc0000d2640?) github.com/charlie-haley/omada_exporter@v0.11.0/cmd/exporter.go:93 +0x27d github.com/urfave/cli/v2.(App).RunContext(0xc000082680, {0xa0a868?, 0xc00002c040}, {0xc000022230, 0x1, 0x1}) github.com/urfave/cli/v2@v2.3.0/app.go:322 +0x97c github.com/urfave/cli/v2.(App).Run(...) github.com/urfave/cli/v2@v2.3.0/app.go:224 github.com/charlie-haley/omada_exporter/cmd.Run() github.com/charlie-haley/omada_exporter@v0.11.0/cmd/exporter.go:54 +0xb34 main.main() github.com/charlie-haley/omada_exporter@v0.11.0/main.go:8 +0x17

charlie-haley commented 10 months ago

Should be fixed by #86, released in v0.11.1, I'll look at updating the test suite to catch stuff like this in the future!