r3kzi / clamav-prometheus-exporter

Prometheus-Exporter for ClamAV
Apache License 2.0
26 stars 21 forks source link

Index out of range on start, causing crash #15

Open micah opened 2 years ago

micah commented 2 years ago

Using current head of the branch, when I try to run the exporter, I get this error:

 panic: runtime error: index out of range [2] with length 1
 goroutine 26 [running]:
 github.com/r3kzi/clamav-prometheus-exporter/pkg/collector.(*Collector).Collect(0xc0001ae100, 0xc000055f60?)
         /usr/pkg/mod/github.com/r3kzi/clamav-prometheus-exporter@v0.0.0-20220525072942-5023a03a9244/pkg/collector/collector.go:139 +0x1452
 github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
         /usr/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:444 +0xfb
 created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
         /usr/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:455 +0x4c5
padraiglennon commented 1 year ago

I am getting this error as well when the exporter is unable to connect to the clamav service which is down


goroutine 7 [running]:
github.com/r3kzi/clamav-prometheus-exporter/pkg/collector.(*Collector).Collect(0xc0000aa100, 0xc000044760?)
        /go/pkg/mod/github.com/r3kzi/clamav-prometheus-exporter@v0.0.0-20220525072942-5023a03a9244/pkg/collector/collector.go:139 +0x1452
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
        /go/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:444 +0x10d
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
        /go/pkg/mod/github.com/prometheus/client_golang@v1.7.1/prometheus/registry.go:455 +0x4bd