Bug 2081648 - python-dmidecode module fails to decode DMI data
Summary: python-dmidecode module fails to decode DMI data
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: python-dmidecode
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Lichen Liu
QA Contact: Jeff Bastian
URL:
Whiteboard:
Depends On:
Blocks: oVirt_on_CentOS_Stream_9_Hosts
TreeView+ depends on / blocked
 
Reported: 2022-05-04 09:38 UTC by Sandro Bonazzola
Modified: 2023-02-06 22:34 UTC (History)
15 users (show)

Fixed In Version: python-dmidecode-3.12.3-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-121015 0 None None None 2022-05-04 09:54:19 UTC

Internal Links: 2103911

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


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