Bug 2081648

Summary: python-dmidecode module fails to decode DMI data
Product: Red Hat Enterprise Linux 9 Reporter: Sandro Bonazzola <sbonazzo>
Component: python-dmidecodeAssignee: Lichen Liu <lichliu>
Status: CLOSED ERRATA QA Contact: Jeff Bastian <jbastian>
Severity: high Docs Contact:
Priority: unspecified    
Version: 9.0CC: ahadas, bstinson, eddie.lopez, guillaume.pavese, jbastian, jwboyer, lichliu, lijiang, litian, ltao, msobczyk, mzamazal, oliver, peter.vreman, ruyang, rvr, yuxisun
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-dmidecode-3.12.3-1.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:
Bug Depends On:    
Bug Blocks: 1986335    

Description Sandro Bonazzola 2022-05-04 09:38:15 UTC
Description of problem:
dmidecode module fails to decode DMI data


How reproducible:
>>> import dmidecode
>>> dmidecode.system()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: [src/dmidecodemodule.c:331] Error decoding DMI data


Journal shows:
kernel: Lockdown: python: /dev/mem,kmem,port is restricted; see man kernel_lockdown.7

If it helps, dmidecode command works fine.


This issue causes error in oVirt project VDSM daemon which relies on dmidecode python module:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/vdsm/API.py", line 1418, in getHardwareInfo
    hw = supervdsm.getProxy().getHardwareInfo()
  File "/usr/lib/python3.9/site-packages/vdsm/common/supervdsm.py", line 56, in __call__
    return callMethod()
  File "/usr/lib/python3.9/site-packages/vdsm/common/supervdsm.py", line 53, in <lambda>
    getattr(self._supervdsmProxy._svdsm, self._funcName)(*args,
  File "<string>", line 2, in getHardwareInfo
  File "/usr/lib64/python3.9/multiprocessing/managers.py", line 825, in _callmethod
    raise convert_to_error(kind, result)
RuntimeError: [src/dmidecodemodule.c:331] Error decoding DMI data


The system is a VM with UEFI Bios.


# rpm -qa |grep dmi
dmidecode-3.3-7.el9.x86_64
python3-dmidecode-3.12.2-27.el9.x86_64

Comment 1 Sandro Bonazzola 2022-05-04 09:49:26 UTC
According to man page SysRq+x should disable the kernel lockdown but running:

echo 1 > /proc/sys/kernel/sysrq
echo x > /proc/sysrq-trigger

shows in dmesg:
sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(v) show-blocked-tasks(w) dump-ftrace-buffer(z)

so looks like the x option is not there.

Comment 2 Dave Young 2022-05-25 01:59:54 UTC
(In reply to Sandro Bonazzola from comment #1)
> According to man page SysRq+x should disable the kernel lockdown but running:
> 
> echo 1 > /proc/sys/kernel/sysrq
> echo x > /proc/sysrq-trigger
> 
> shows in dmesg:
> sysrq: HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e)
> memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k)
> show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n)
> poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s)
> show-task-states(t) unmount(u) force-fb(v) show-blocked-tasks(w)
> dump-ftrace-buffer(z)
> 
> so looks like the x option is not there.

"x" does not mean "x" here, it is just refer to any usable options in the kernel sysrq table above.  For lockdown, it is not possible to disable it on runtime unless you disable it in grub kernel cmdline (it may not work for Secure Boot case because kernel will lockdown automatically).

Comment 7 Sandro Bonazzola 2022-06-10 11:30:58 UTC
looks like the issue was known since 2019: https://github.com/nima/python-dmidecode/issues/15

project looks abandoned since a year ago, last merged commit being f0a089a on 30 Jun 2021

Project owner seems to be https://www.linkedin.com/in/nimatalebi/ did you try contacting him?

Comment 19 Guillaume Pavese 2022-10-26 06:57:03 UTC
(In reply to Sandro Bonazzola from comment #7)
> looks like the issue was known since 2019:
> https://github.com/nima/python-dmidecode/issues/15
> 
> project looks abandoned since a year ago, last merged commit being f0a089a
> on 30 Jun 2021
> 
> Project owner seems to be https://www.linkedin.com/in/nimatalebi/ did you
> try contacting him?

The Github issue  was recently updated (Sept 5 2022) with a comment from the developer :
https://github.com/nima/python-dmidecode/issues/15#issuecomment-1236772035
"This issue has been fixed in the smbios-3.3.0 branch. Could you please have a try? If there are any issues, welcome to report it. Thanks."

The issue has since been closed as "completed" today, pointing to commit https://github.com/nima/python-dmidecode/commit/c97d1ca021ddc160d70525d0840b1731f50ac4ca

I hope this can make it soon to Centos/oVirt as I am stuck trying to deploy hosted-engine on a Centos 9 with secure boot ?

Comment 20 Sandro Bonazzola 2022-10-26 07:01:54 UTC
Lichen Liu, any update?

Comment 21 Lichen Liu 2022-10-26 07:20:28 UTC
(In reply to Sandro Bonazzola from comment #20)
> Lichen Liu, any update?

Hello,

We did a scratch build a few days ago, but there are some bugs. The developer pushed some new commits to the GitHub today, we are still working on the testing work.

Thanks,
Lichen

Comment 26 Guillaume Pavese 2023-01-03 05:53:29 UTC
Just to note that I have manually installed the new version v3.12.3 from the python-dmidecode github repo and that resolved my ovirt deployment problem.
Please consider releasing the fixed packages to rhel/centos

Comment 35 eddie lopez 2023-05-04 22:16:41 UTC
(In reply to Guillaume Pavese from comment #26)
> Just to note that I have manually installed the new version v3.12.3 from the
> python-dmidecode github repo and that resolved my ovirt deployment problem.
> Please consider releasing the fixed packages to rhel/centos

The v3.12.3 resolved my RHEL v9.1 issue as well with RuntimeError: >>> Error decoding DMI data in VMware virtual machine environment.

Comment 37 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