Skip to content

Not all /sys/block devices will have a "dev" file #3340

@mattysweeps

Description

@mattysweeps

I see the following error message in kubelet logs:

Jun 00 00:00:00 my-worker-node kubelet[XXXXXXX]: E0000 00:00:00.000000 2571634 info.go:99] Failed to get disk map: open /sys/block/nvme0c0n1/dev: no such file or directory

This error message matches cadvisor here:

klog.Errorf("Failed to get disk map: %v", err)

Looking for usages of /dev this is the culprit:

dev, err := os.ReadFile(path.Join(blockDir, name, "/dev"))

Full Stack:

According to linux kernel source: the device name scheme means the device is in subsystem 0, controller 0, namespace 1
https://elixir.bootlin.com/linux/latest/source/drivers/nvme/host/core.c#L4361

This is a device for internal kernel usage only, and it's flagged as such with GENHD_FL_HIDDEN.

Therefore, it's probably wrong that cadvisor is trying to read this device. It should probably be ignored with a similar rule as here:

if strings.HasPrefix(name, "loop") || strings.HasPrefix(name, "ram") || strings.HasPrefix(name, "sr") {

I'm not an NVMe expert. I've been told that this type of device might only be present when multipathing is enabled.
I'm also not sure what machine/info.go is doing with the information it gets from the block devices, so I'm not sure the impact here, other than there's a lot of errors in my kubelet log output.

Note that for _, disk := range disks { the err is return directly from the disk range, meaning other disks might not be gathered or inspected.

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