xperimental / netatmo-exporter

Prometheus exporter for Netatmo sensor data.
MIT License
44 stars 18 forks source link

Panic: runtime error: invalid memory address or nil pointer dereference #18

Closed tukane closed 1 year ago

tukane commented 2 years ago

Hi, since a few days the exporter container stops running with the error message "panic: runtime error: invalid memory address or nil pointer dereference".

2022-01-14T03:52:25.314494588Z panic: runtime error: invalid memory address or nil pointer dereference
2022-01-14T03:52:25.314625027Z [signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x6b25fd]
2022-01-14T03:52:25.314681766Z 
2022-01-14T03:52:25.314747723Z goroutine 2602 [running]:
2022-01-14T03:52:25.314813562Z github.com/exzz/netatmo-api-go.processHTTPResponse(0x85dfe0, {0x921800, 0xc00021a180}, {0x81f640, 0xc000536c78})
2022-01-14T03:52:25.314862906Z  /go/pkg/mod/github.com/exzz/netatmo-api-go@v0.0.0-20201009073308-a8620474d1ea/weather.go:176 +0x5d
2022-01-14T03:52:25.314911729Z github.com/exzz/netatmo-api-go.(*Client).Read(0xc000228960)
2022-01-14T03:52:25.314933486Z  /go/pkg/mod/github.com/exzz/netatmo-api-go@v0.0.0-20201009073308-a8620474d1ea/weather.go:204 +0x12f
2022-01-14T03:52:25.314970576Z github.com/xperimental/netatmo-exporter/internal/collector.(*NetatmoCollector).RefreshData(0xc0001902d0, {0xc00019cf90, 0xc000200c00, 0xc33160})
2022-01-14T03:52:25.314989742Z  /build/internal/collector/collector.go:181 +0x1d9
2022-01-14T03:52:25.315004392Z created by github.com/xperimental/netatmo-exporter/internal/collector.(*NetatmoCollector).Collect
2022-01-14T03:52:25.315027183Z  /build/internal/collector/collector.go:144 +0x105

Any ideas, what's wrong here?

Regards tukane

xperimental commented 2 years ago

This seems to be an issue with the API client that is used by the exporter. This is a known issue and points to a connection issue between the exporter and the netatmo API. The client should be able to handle that situation more gracefully but currently isn't. It will be fixed in the near future by switching the client to a different version.

xperimental commented 1 year ago

This error should be fixed now in master branch since switching to the fork. I'm closing this issue. Please reopen if this reoccurs with the latest version.