Block probing sometimes crashes because /sys/class/block/<device>/size does not exist

Bug #2063433 reported by Olivier Gayot
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
subiquity
Triaged
Medium
Olivier Gayot

Bug Description

We have had at least 3 distinct private reports of block probing failing because we could not read a /sys/class/block/<device>/size file

  File "/probert/storage.py", line 142, in blockdev_probe
    str(read_sys_block_size_bytes(devname))
  File "/probert/utils.py", line 300, in read_sys_block_size_bytes
    with open(blockdev_size) as d:
FileNotFoundError: [Errno 2] No such file or directory: '/sys/class/block/nvme0n1p4/size'
2024-04-24 18:25:52,722 DEBUG subiquity.common.errorreport:398 generating crash report

The error does not explicitly tell whether it is the /sys/block/<device> directory that does not exist, or the /sys/block/<device>/size file specifically.

Although this could be due to a race condition when a given device is unplugged during probing, I think it is quite unlikely for NVMe devices.

I would like to consider:

1. writing a new function that takes the value of DEVPATH instead of DEVNAME (so we don't have to "guess" where to find the device in the sysfs).
2. in case of error, logging whether the directory existed and/or the size file.

Olivier Gayot (ogayot)
description: updated
Changed in subiquity:
assignee: nobody → Olivier Gayot (ogayot)
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Olivier Gayot (ogayot) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.