Skip to content

Fibre Channel collector panics when sysfs statistics counters are missing #3817

Description

@itjustnathan

Problem

The Fibre Channel collector can panic during a scrape when an FC host does not expose all expected statistics files under /sys/class/fc_host/<host>/statistics.

The procfs library represents unavailable counters as nil pointers, but the collector dereferences them unconditionally.

Panic

node_exporter[1070004]: panic: runtime error: invalid memory address or nil pointer dereference
node_exporter[1070004]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa2f259]
node_exporter[1070004]: goroutine 89 [running]:
node_exporter[1070004]: github.com/prometheus/node_exporter/collector.(*fibrechannelCollector).Update(0xc00014cf90, 0xc00037fd50)
node_exporter[1070004]:         /Volumes/Home/go/node_exporter/collector/fibrechannel_linux.go:133 +0x479
node_exporter[1070004]: github.com/prometheus/node_exporter/collector.execute({0xc098f3, 0xc}, {0xd34e00, 0xc00014cf90}, 0xc00037fd50, 0xc00003e480)
node_exporter[1070004]:         /Volumes/Home/go/node_exporter/collector/collector.go:160 +0x82
node_exporter[1070004]: github.com/prometheus/node_exporter/collector.NodeCollector.Collect.func1({0xc098f3?, 0x0?}, {0xd34e00?, 0xc00014cf90?})
node_exporter[1070004]:         /Volumes/Home/go/node_exporter/collector/collector.go:151 +0x33
node_exporter[1070004]: created by github.com/prometheus/node_exporter/collector.NodeCollector.Collect in goroutine 60
node_exporter[1070004]:         /Volumes/Home/go/node_exporter/collector/collector.go:150 +0xce

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions