Bug 1824195

Summary: Exception thrawn logging a message, but not preventing the installation to continue
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: python-blivetAssignee: Vojtech Trefny <vtrefny>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: jstodola, pzatko, vtrefny
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-blivet-3.2.2-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 03:22:25 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:

Description Renaud Métrich 2020-04-15 14:14:04 UTC
Description of problem:

There is a typo in the string construction in blivet/devicelibs/edd.py at line 222:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
221         if any([self.fibre_wwid, self.fibre_lun]):
222             s += "%(nl)s%(t)sfibre wwid: %(fibre_wwid)s lun: %s(fibre_lun)s"
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Fix (no "%s", but "%"):
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
221         if any([self.fibre_wwid, self.fibre_lun]):
222             s += "%(nl)s%(t)sfibre wwid: %(fibre_wwid)s lun: %(fibre_lun)s"
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This makes installation on FC disks fail with the following exception:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/__init__.py", line 994, in emit
    msg = self.format(record)
  File "/usr/lib64/python3.6/logging/__init__.py", line 840, in format
    return fmt.format(record)
  File "/usr/lib64/python3.6/logging/__init__.py", line 577, in format
    record.message = record.getMessage()
  File "/usr/lib64/python3.6/logging/__init__.py", line 338, in getMessage
    msg = msg % self.args
  File "/usr/lib/python3.6/site-packages/blivet/devicelibs/edd.py", line 268, in __repr__
    return "<EddEntry%s>" % (self._fmt(' ', ''),)
  File "/usr/lib/python3.6/site-packages/blivet/devicelibs/edd.py", line 232, in _fmt
    return s % d
TypeError: not enough arguments for format string
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


Version-Release number of selected component (if applicable):

anaconda 29.19.1.13-1.el8 (RHEL 8.1.0 DVD)


How reproducible:

Always on customer system

Steps to Reproduce:

1. Execute python3 interpreter

$ python3
>>> s = "%(nl)s%(t)s fibre wwid: %(fibre_wwid)s lun: %s(fibre_lun)s"
>>> d = {'t': '\t',
    'sysfspath': 'SYSFSPATH',
    'version': 'VERSION',
    'nl': '\n',
    'mbr_sig': 'MBR_SIG',
    'sectors': 'SECTORS',
    'type': 'TYPE',
    'sysfslink': 'SYSFSLINK',
    'host_bus': 'HOST_BUS',
    'pci_dev': 'PCI_DEV',
    'channel': 'CHANNEL',
    'interface': 'INTERFACE',
    'atapi_device': 'ATAPI_DEVICE',
    'atapi_lun': 'ATAPI_LUN',
    'ata_device': 'ATA_DEVICE',
    'ata_pmp': 'ATA_PMP',
    'scsi_id': 'SCSI_ID',
    'scsi_lun': 'SCSI_LUN',
    'usb_serial': 'USB_SERIAL',
    'ieee1394_eui64': 'IEEE1394_EUI64',
    'fibre_wwid': 'FIBRE_WWID',
    'fibre_lun' : 'FIBRE_LUN',
    'i2o_identity': 'I2O_IDENTITY',
    'sas_address': 'SAS_ADDRESS',
    'sas_lun': 'SAS_LUN'
}
>>> s % d

Actual results:

>>> s % d
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string


Expected results:

No exception

Comment 1 Renaud Métrich 2020-04-15 14:15:40 UTC
I'm also requesting a hotfix as an update image to provide to customers falling into this.
I will create a KCS asap.

Comment 2 Vojtech Trefny 2020-04-15 14:40:20 UTC
Thank you for investigating this and the fix.

upstream PR: https://github.com/storaged-project/blivet/pull/835

updates image: https://vtrefny.fedorapeople.org/img/rhbz1824195.img

Comment 3 Renaud Métrich 2020-04-16 07:07:36 UTC
I am lowering the Severity/Priority because this exception doesn't prevent from installing, sorry for the noise.

Comment 10 errata-xmlrpc 2020-11-04 03:22:25 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-2020:4728