Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tuned 2.21 not working with python3.12 #10607

Open
ankithmr opened this issue Oct 2, 2024 · 5 comments
Open

tuned 2.21 not working with python3.12 #10607

ankithmr opened this issue Oct 2, 2024 · 5 comments
Assignees
Labels
3.0 PRs Destined for 3.0 bug Something isn't working

Comments

@ankithmr
Copy link

ankithmr commented Oct 2, 2024

tuned 2.21 service fails to start with python 3.12. It seems in Python3.12 inspect.getargspec() has been deprecated.

$ rpm -iq tuned
tuned-2.21.0-1.azl3.noarch

To Reproduce
Steps to reproduce the behavior:

  1. systemctl enable tuned
 systemctl status tuned
× tuned.service - Dynamic System Tuning Daemon
     Loaded: loaded (/usr/lib/systemd/system/tuned.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: timeout) since Thu 2024-10-03 12:41:05 UTC; 7min ago
       Docs: man:tuned(8)
             man:tuned.conf(5)
             man:tuned-adm(8)
   Main PID: 99148 (code=exited, status=0/SUCCESS)
        CPU: 432ms

  File "/usr/lib/python3.12/site-packages/tuned/exports/dbus_exporter.py", line 170>
    wrapper = dbus.service.signal(self._interface_name, out_signature)(wrapper)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dbus/decorators.py", line 329, in decorat>
    args = inspect.getargspec(func)[0]
           ^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'geta>
systemd[1]: tuned.service: start operation timed out. Terminating.
systemd[1]: tuned.service: Failed with result 'timeout'.
systemd[1]: Failed to start tuned.service - Dynamic System Tuning Daemon.

@ankithmr ankithmr added the bug Something isn't working label Oct 2, 2024
@mfrw mfrw self-assigned this Oct 4, 2024
@mfrw
Copy link
Member

mfrw commented Oct 4, 2024

Thank you for bringing this to our notice.

@zcobol
Copy link

zcobol commented Oct 4, 2024

The correct invocation is inspect.getfullargspec() and if you change it to args = inspect.getfullargspec(func)[0] in /usr/lib/python3.12/site-packages/dbus/decorators.py around line 330 then systemctl start tuned works fine.

See details at https://docs.python.org/3/library/inspect.html

@ankithmr
Copy link
Author

ankithmr commented Oct 7, 2024

I have managed to make it work by changing inspect.getfullargspec() to this args = inspect.getfullargspec(func)[0] in /usr/lib/python3.12/site-packages/dbus/decorators.py. However, shouldn't it be fixed in the python3.12 rpm itself ? I am using the default that comes with AZL3: https://packages.microsoft.com/azurelinux/3.0/prod/base/x86_64/Packages/p/python3-3.12.3-2.azl3.x86_64.rpm . I think updating https://packages.microsoft.com/azurelinux/3.0/prod/base/x86_64/Packages/d/dbus-python-devel-1.2.16-3.azl3.x86_64.rpm to latest version (dbus-python 1.3.2) (I guess its taken from RHEL) should fix it.

@mfrw mfrw added the 3.0 PRs Destined for 3.0 label Oct 8, 2024
@ankithmr
Copy link
Author

Anything on this ?

@xfoukas
Copy link
Contributor

xfoukas commented Dec 23, 2024

Has there been any update with regards to this issue? Even with the workaround suggested above, the daemon can start, but the service does not work properly, with more python issues reported. This is what I see in the tuned logs under /var/log/tuned/tuned.log, once the service is started:

  self._call_scripts(instance._scripts, ["start"])
  File "/usr/lib/python3.12/site-packages/tuned/plugins/plugin_script.py", line 78, in _call_scripts
    if not self._safe_script_path(script):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/tuned/plugins/base.py", line 217, in _safe_script_path
    profile_paths = self._global_cfg.get_list(consts.CFG_PROFILE_DIRS, consts.CFG_DEF_PROFILE_DIRS)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GlobalConfig' object has no attribute 'get_list'. Did you mean: 'get_int'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 PRs Destined for 3.0 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants