Skip to content

sysfs.Mdraids() produces a parsing error on a host with Intel VROC #771

@NeonSludge

Description

@NeonSludge

node_exporter 1.10.2 crashes on startup when an Intel VROC array is present:

time=2025-12-16T16:42:00.321Z level=ERROR source=collector.go:168 msg="collector failed" name=mdadm duration_seconds=0.000467605 err="error parsing mdraids: strconv.ParseUint: parsing \"\": invalid syntax"

Some details about this system:

# cat /proc/mdstat 
Personalities : [raid1] 
md126 : active raid1 nvme2n1[1] nvme3n1[0]
      1781602304 blocks super external:/md127/0 [2/2] [UU]
      
md127 : inactive nvme3n1[1](S) nvme2n1[0](S)
      10402 blocks super external:imsm
       
unused devices: <none>

# mdadm --detail /dev/md126
/dev/md126:
         Container : /dev/md/imsm, member 0
        Raid Level : raid1
        Array Size : 1781602304 (1699.07 GiB 1824.36 GB)
     Used Dev Size : 1781602304 (1699.07 GiB 1824.36 GB)
      Raid Devices : 2
     Total Devices : 2

             State : active 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0

Consistency Policy : resync


              UUID : d3edfb8f:0c75df7d:44f62912:3e5c5b6b
    Number   Major   Minor   RaidDevice State
       1     259        4        0      active sync   /dev/nvme2n1
       0     259        0        1      active sync   /dev/nvme3n1

# mdadm --detail /dev/md127
/dev/md127:
           Version : imsm
        Raid Level : container
     Total Devices : 2

   Working Devices : 2


              UUID : f10bec73:eef3d2ef:9450dac5:e2973bd8
     Member Arrays : /dev/md/VrocVolume00

    Number   Major   Minor   RaidDevice

       -     259        4        -        /dev/nvme2n1
       -     259        0        -        /dev/nvme3n1

It seems that this is because prometheus/procfs fails to parse the /sys/class/block/mdX/md/raid_disks file when it is present but empty:

procfs/sysfs/mdraid.go

Lines 85 to 89 in 638b55c

if val, err := util.ReadUintFromFile(filepath.Join(path, "raid_disks")); err == nil {
md.Disks = val
} else {
return mdraids, err
}

// ReadUintFromFile reads a file and attempts to parse a uint64 from it.
func ReadUintFromFile(path string) (uint64, error) {
data, err := os.ReadFile(path)
if err != nil {
return 0, err
}
return strconv.ParseUint(strings.TrimSpace(string(data)), 10, 64)
}

In the case of VROC container arrays this file is empty:

# cat /sys/class/block/md126/md/raid_disks
2

# cat /sys/class/block/md127/md/raid_disks
#

Some more details about the environment:
node_exporter version: 1.10.2
prometheus/procfs version: 0.19.0
OS: AlmaLinux 9.4
Kernel version: 5.14.0-427.42.1.el9_4.x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions