Bug 1263832 - blivet.devicescan.populate fails if blivet is unable to scan a disk
blivet.devicescan.populate fails if blivet is unable to scan a disk
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Anaconda Maintenance Team
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-16 16:20 EDT by Lars Kellogg-Stedman
Modified: 2016-12-20 11:45 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 09:39:24 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Anaconda responds to an exception from blivet. (23.94 KB, image/png)
2015-09-17 11:53 EDT, Lars Kellogg-Stedman
no flags Details

  None (edit)
Description Lars Kellogg-Stedman 2015-09-16 16:20:04 EDT
This is with anaconda-core-23.17-1.fc23.x86_64 (python3-blivet-1.10-1.fc23.noarch).

My install of the F23 pre-release was failing at 
"/usr/lib64/python3.4/site-packages/pyanaconda/packaging/livepayload.py" line 78 because storage.devicetree.getDeviceByPath(self.data.method.partition) was returning None when self.data.method.partition = '/dev/mapper/live-base'.

It looks like this was because blivet failed to discover all available block devices, due to the following error:

>>> import blivet
>>> b = blivet.Blivet()
>>> b.devicetree.populate()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/blivet/devicetree.py", line 554, in populate
    self._populator.populate(cleanupOnly=cleanupOnly)
  File "/usr/lib/python3.4/site-packages/blivet/populator.py", line 1597, in populate
    self._populate()
  File "/usr/lib/python3.4/site-packages/blivet/populator.py", line 1660, in _populate
    self.addUdevDevice(dev)
  File "/usr/lib/python3.4/site-packages/blivet/populator.py", line 724, in addUdevDevice
    device = self.addUdevPartitionDevice(info)
  File "/usr/lib/python3.4/site-packages/blivet/populator.py", line 448, in addUdevPartitionDevice
    raise cls(msg)
blivet.errors.DiskLabelScanError: failed to scan disk sdd


I think there are two bugs here:

(1) If blivet raises an exception like this, maybe anaconda should report an error rather than trying to continue with potentially invalid information.  In this case, the error message in the exception would have swiftly pinpointed the source of the problem.

(2) Blivet should probably *continue* the device scan on this sort of failure, rather than aborting.

On my system, /dev/sdd is a USB-attached disk:

# udevadm info /dev/sdd
P: /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.8/4-1.8.5/4-1.8.5.4/4-1.8.5.4:1.0/host8/target8:0:0/8:0:0:0/block/sdd
N: sdd
S: disk/by-id/usb-Hitachi_HDT721010SLA360_48014b3efd49130246000000-0:0
S: disk/by-path/pci-0000:00:1d.0-usb-0:1.8.5.4:1.0-scsi-0:0:0:0
E: DEVLINKS=/dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.8.5.4:1.0-scsi-0:0:0:0 /dev/disk/by-id/usb-Hitachi_HDT721010SLA360_48014b3efd49130246000000-0:0
E: DEVNAME=/dev/sdd
E: DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.8/4-1.8.5/4-1.8.5.4/4-1.8.5.4:1.0/host8/target8:0:0/8:0:0:0/block/sdd
E: DEVTYPE=disk
E: ID_BUS=usb
E: ID_FS_TYPE=zfs_member
E: ID_FS_USAGE=raid
E: ID_FS_VERSION=5000
E: ID_INSTANCE=0:0
E: ID_MODEL=HDT721010SLA360
E: ID_MODEL_ENC=HDT721010SLA360\x20
E: ID_MODEL_ID=1018
E: ID_PATH=pci-0000:00:1d.0-usb-0:1.8.5.4:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_8_5_4_1_0-scsi-0_0_0_0
E: ID_REVISION=0001
E: ID_SERIAL=Hitachi_HDT721010SLA360_48014b3efd49130246000000-0:0
E: ID_SERIAL_SHORT=48014b3efd49130246000000
E: ID_TYPE=disk
E: ID_USB_DRIVER=usb-storage
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Hitachi
E: ID_VENDOR_ENC=Hitachi\x20
E: ID_VENDOR_ID=059f
E: MAJOR=8
E: MINOR=48
E: MPATH_SBIN_PATH=/sbin
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=2166209200

...containing a single partition:

# fdisk -l /dev/sdd
Disk /dev/sdd: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 31955D49-D084-4334-96AC-CA22B68B6B32

Device     Start        End    Sectors   Size Type
/dev/sdd1   2048 1953525134 1953523087 931.5G Linux filesystem

Simply powering off the device permitted the install to continue.
Comment 1 Lars Kellogg-Stedman 2015-09-17 09:53:07 EDT
I've proposed a fix here:

https://github.com/rhinstaller/blivet/pull/227

Someone more familiar with the code would have to weigh in on whether or not that makes sense.
Comment 2 David Lehman 2015-09-17 11:29:13 EDT
You should be presented with an error dialog explaining the problem and offering some guidance on how to proceed. Please attach the logs from /tmp so I can see why this did not happen. Thanks.
Comment 3 Lars Kellogg-Stedman 2015-09-17 11:32:58 EDT
I'm afraid the logs are gone and the problem is no longer directly reproducible (because I reformatted the problematic device).  However, you can trivially reproduce the error by editing /usr/lib/python3.4/site-packages/blivet/populator.py and having it raise a blivet.errors.DiskLabelScanError exception.

I'll give that a shot today and post the logs.
Comment 4 Lars Kellogg-Stedman 2015-09-17 11:53:07 EDT
Created attachment 1074497 [details]
Anaconda responds to an exception from blivet.

This is the UI response to the exception raised by blivet.
Comment 5 Lars Kellogg-Stedman 2015-09-17 11:53:36 EDT
I added the following to the top of addUdevPartitiondevice:

if 'vdb1' in name:
  msg = "failed to scan disk %s" % name
  cls = DiskLabelScanError
  raise cls(msg)

This reproduces the failure I was seeing.  I've submitted bz #1248225 from anaconda; that bz has all of the logs attached.  I've attached to this bz a screenshot showing the UI response to this failure.
Comment 6 Fedora End Of Life 2016-11-24 07:31:30 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 Fedora End Of Life 2016-12-20 09:39:24 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.