Bug 2300115 - blivet crashes if asked for the type UUID of a partition on an msdos-labeled disk
Summary: blivet crashes if asked for the type UUID of a partition on an msdos-labeled ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-blivet
Version: rawhide
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Vojtech Trefny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: openqa
Depends On:
Blocks: F41BetaBlocker
TreeView+ depends on / blocked
 
Reported: 2024-07-26 18:16 UTC by Adam Williamson
Modified: 2024-07-30 19:13 UTC (History)
8 users (show)

Fixed In Version: python-blivet-3.10.1-4.fc41
Clone Of:
Environment:
Last Closed: 2024-07-30 19:13:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github storaged-project blivet pull 1265 0 None open part_type_uuid: guard against pyparted type_uuid being None 2024-07-26 18:26:58 UTC

Description Adam Williamson 2024-07-26 18:16:26 UTC
Description of problem:
anaconda since 41.26 will ask blivet for the type UUID of partitions on msdos-labeled disks in some circumstances (when scanning a disk for existing Windows devices). This causes blivet to crash:

Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/dasbus/server/handler.py", line 455, in _method_callback
    result = self._handle_call(
        interface_name,
    ...<2 lines>...
        **additional_args
    )
  File "/usr/lib/python3.13/site-packages/dasbus/server/handler.py", line 265, in _handle_call
    return handler(*parameters, **additional_args)
  File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer_interface.py", line 194, in GetExistingSystems
    return OSData.to_structure_list(self.implementation.get_existing_systems())
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer.py", line 491, in get_existing_systems
    windows_data = self._get_windows_data()
  File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer.py", line 528, in _get_windows_data
    if str(device.part_type_uuid) == EFI_PARTITION_TYPE:
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/blivet/threads.py", line 49, in run_with_lock
    return m(*args, **kwargs)
  File "/usr/lib/python3.13/site-packages/blivet/devices/partition.py", line 382, in part_type_uuid
    return UUID(bytes=self.parted_partition.type_uuid)
  File "/usr/lib64/python3.13/uuid.py", line 175, in __init__
    raise TypeError('one of the hex, bytes, bytes_le, fields, '
                    'or int arguments must be given')
TypeError: one of the hex, bytes, bytes_le, fields, or int arguments must be given

This is because pyparted, when asked for the type UUID of a partition on an msdos-labeled disk, returns None (because parted tells it msdos-labeled disks do not support type UUIDs, which is true), and blivet goes right ahead and passes that return value to `uuid.UUID`, which chokes on it (as the error more or less says, it requires exactly one of the five input args to not be None).

Version-Release number of selected component (if applicable): python-blivet-3.10.1-3.fc41

How reproducible: 100%

Steps to Reproduce:
1. Set up an existing disk with an msdos label and some partitions
2. Boot an installer with anaconda 41.26 or later with the disk attached
3. Select the disk as the install target, and try to go to the 'reclaim space' page

Actual results:
anaconda crashes with the above traceback

Expected results:
anaconda should not crash

Additional info:
Proposed fix at https://github.com/storaged-project/blivet/pull/1265

Proposing as a Beta blocker per "When using the guided partitioning flow, the installer must be able to: Cleanly install to a disk with a valid ms-dos or gpt disk label and partition table which contains existing data and sufficient unpartitioned space for a Fedora installation ... Remove existing storage volumes to free up space, at the user's direction"

Comment 1 Adam Williamson 2024-07-30 16:09:15 UTC
This should be fixed in the next compose, waiting for it to be finished so we can confirm.

Comment 2 Adam Williamson 2024-07-30 19:13:46 UTC
Fix confirmed.


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