Bug 1988276

Summary: Error message for unavailable technologies should include reason why the technology is not available
Product: Red Hat Enterprise Linux 8 Reporter: Vojtech Trefny <vtrefny>
Component: python-blivetAssignee: Vojtech Trefny <vtrefny>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: jstodola, pzatko
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-blivet-3.4.0-7.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2012121 (view as bug list) Environment:
Last Closed: 2022-05-10 14:07:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2012121    

Description Vojtech Trefny 2021-07-30 09:04:37 UTC
When user tries to create a device on a system that doesn't support creating this device (missing tools, old version of a library etc.) blivet throws exception with error message that doesn't contain the full explanation why the device cannot be created. For LVM VDO this looks like:

---
device type lvmvdopool requires unavailable_dependencies: libblockdev lvm plugin (vdo technology)
---

This error doesn't contain information what is actually missing. In this case it's missing VDO kernel module. Blivet has the information available so we should add the "full" reason to the error message to make the problem easier to debug:

---
device type lvmvdopool requires unavailable_dependencies: libblockdev lvm plugin (vdo technology):
libblockdev plugin lvm is loaded but some required technologies are not available: Kernel module 'kvdo' not available
---

Blivet already has all this information available so we just need to change the error message.

Comment 2 Vojtech Trefny 2021-10-07 11:11:03 UTC
upstream PR: https://github.com/storaged-project/blivet/pull/973

Comment 3 Jan Stodola 2021-10-07 14:12:23 UTC
Vojto, do you have an easy reproducer how to get the error message?

Comment 4 Vojtech Trefny 2021-10-08 10:31:30 UTC
(In reply to Jan Stodola from comment #3)
> Vojto, do you have an easy reproducer how to get the error message?

LVM VDO is not supported by Anaconda yet so this can be reproduced only with blivet.
You need a system without the kmod-kvdo package and then you can run our LVM VDO example: `python3 /usr/share/doc/python3-blivet/examples/lvm_vdo.py` and it should crash with the error message:

-----
$ sudo python3 /usr/share/doc/python3-blivet/examples/lvm_vdo.py
Traceback (most recent call last):
  File "/usr/share/doc/python3-blivet/examples/lvm_vdo.py", line 44, in <module>
    b.create_device(pool)
  File "/usr/lib/python3.9/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/blivet/blivet.py", line 784, in create_device
    action_create_dev = ActionCreateDevice(device)
  File "/usr/lib/python3.9/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/blivet/deviceaction.py", line 331, in __init__
    DeviceAction.__init__(self, device)
  File "/usr/lib/python3.9/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/blivet/deviceaction.py", line 168, in __init__
    self._check_device_dependencies()
  File "/usr/lib/python3.9/site-packages/blivet/threads.py", line 53, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/blivet/deviceaction.py", line 177, in _check_device_dependencies
    raise DependencyError("device type %s requires unavailable_dependencies: %s" % (self.device.type, dependencies_str))
blivet.errors.DependencyError: device type lvmvdopool requires unavailable_dependencies: libblockdev lvm plugin (vdo technology)
-----

Comment 10 Jan Stodola 2021-12-02 09:24:08 UTC
python3-blivet-3.4.0-7.el8 is included in RHEL-8.6.0-20211201.1, moving to VERIFIED.

Comment 12 errata-xmlrpc 2022-05-10 14:07:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (python-blivet bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1880