Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2166716

Summary: python3-dmidecode-3.12.3-1 Attribute unit redefined
Product: Red Hat Enterprise Linux 9 Reporter: John Kacur <jkacur>
Component: python-dmidecodeAssignee: Lichen Liu <lichliu>
Status: CLOSED ERRATA QA Contact: Jeff Bastian <jbastian>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.2CC: jbastian
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-dmidecode-3.12.3-2.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:25:01 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 John Kacur 2023-02-02 17:53:44 UTC
Description of problem:

The latest version of python-dmidecode will produce invalid XML on certain BIOS
namely: Attribute unit redefined

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

python3-dmidecode-3.12.3-1

if you downgrade to python3-dmidecode-3.12.2-27.el9, the problem doesn't occur

How reproducible:
Every-time on affected hardware
(Not all hardware has the problem)

Steps to Reproduce:
1. Run the following program

# cat dmidecode_test.py
#!/usr/bin/python

import lxml
import libxml2
import dmidecode
import lxml.etree

dmixml = dmidecode.dmidecodeXML()
dmixml.SetResultType(dmidecode.DMIXML_DOC)
dmiqry = dmixml.QuerySection('all')
root = dmiqry.getRootElement()
res = lxml.etree.XML(root.serialize('UTF-8'))

# ./dmidecode_test.py


Actual results:

Traceback (most recent call last):
  File "/root/./dmidecode_test.py", line 11, in <module>
    res = lxml.etree.XML(root.serialize('UTF-8'))
  File "src/lxml/etree.pyx", line 3216, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1899, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1780, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1085, in lxml.etree._BaseParser._parseUnicodeDoc
  File "src/lxml/parser.pxi", line 618, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 728, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 657, in lxml.etree._raiseParseError
  File "<string>", line 1
lxml.etree.XMLSyntaxError: Attribute unit redefined, line 1, column 12281


Expected results:
No Traceback

Additional info:
rteval uses python-dmidecode to provide information about the hardware during testing of real-time performance, so this is important to our customers

Comment 1 John Kacur 2023-02-02 19:54:25 UTC
I've further enhanced the output now so it looks like this

[DEBUG] ** EXCEPTION Attribute unit redefined, line 1, column 12281 (<string>, line 1), will query BIOS only
...
   Model:         - 
   BIOS version: Dell Inc. (ver: 1.6.5, rev :1.6, release date: 04/15/2022)

Comment 2 John Kacur 2023-02-02 19:57:23 UTC
(In reply to John Kacur from comment #1)
> I've further enhanced the output now so it looks like this
> 
> [DEBUG] ** EXCEPTION Attribute unit redefined, line 1, column 12281
> (<string>, line 1), will query BIOS only
> ...
>    Model:         - 
>    BIOS version: Dell Inc. (ver: 1.6.5, rev :1.6, release date: 04/15/2022)

Please ignore this comment, it was intended for another bz

Comment 15 errata-xmlrpc 2023-05-09 08:25:01 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-dmidecode 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-2023:2562