Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mattysweeps opened this issue Jun 26, 2023 · 3 comments
Open

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

mattysweeps opened this issue Jun 26, 2023 · 3 comments

Comments

@mattysweeps
Copy link

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.

@matthewei
Copy link

Hi, @mattysweeps I meet the same issue, is there any progress? could you share me some info?

@mattysweeps
Copy link
Author

Hi @matthewei

I'm not currently investigating a fix. The code change is simple, but I'm not sure how to properly test it.

@rogerwegmanneit
Copy link

I got this error message by using mayastor 2.4 with microk8s. And you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants