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 2159680 - Traceback raised by tuned when busctl/dbus-send is used with nonsense (typo) command.
Summary: Traceback raised by tuned when busctl/dbus-send is used with nonsense (typo) ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: tuned
Version: 9.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Robin Hack
URL:
Whiteboard:
: 2159665 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-10 11:39 UTC by Robin Hack
Modified: 2023-05-09 10:43 UTC (History)
4 users (show)

Fixed In Version: tuned-2.20.0-0.1.rc1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 08:26:31 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-144652 0 None None None 2023-01-10 11:48:26 UTC
Red Hat Product Errata RHBA-2023:2585 0 None None None 2023-05-09 08:26:37 UTC

Description Robin Hack 2023-01-10 11:39:51 UTC
Description of problem:


Version-Release number of selected component (if applicable):
systemd-252-2.el9.x86_64

How reproducible:
always


Steps to Reproduce:
busctl --system call com.redhat.tuned '/Tuned' com.redhat.tuned.contro active_profile

(missing letter 'l' in word control)

Actual results:
Call failed: Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 662, in _message_cb
    (candidate_method, parent_method) = _method_lookup(self, method_name, interface_name)
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 252, in _method_lookup
    raise UnknownMethodException('%s is not a valid method of interface %s' % (method_name, dbus_interface))
dbus.exceptions.UnknownMethodException: org.freedesktop.DBus.Error.UnknownMethod: Unknown method: active_profile is not a valid method of interface com.redhat.tuned.contro


Expected results:
Something nice and not traceback?


Additional info:

Comment 1 Frantisek Sumsal 2023-01-10 12:06:43 UTC
The traceback is not from busctl (which is written in C using sd-bus), but from tuned (or, more specifically, the dbus Python library it uses), we just show what the remote side sent us:

# SYSTEMD_LOG_LEVEL=debug busctl --system --verbose call com.redhat.tuned '/Tuned' com.redhat.tuned.contro active_profileq 
Bus n/a: changing state UNSET → OPENING
sd-bus: starting bus by connecting to /run/dbus/system_bus_socket...
Bus n/a: changing state OPENING → AUTHENTICATING
Bus n/a: changing state AUTHENTICATING → HELLO
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.39 path=n/a interface=n/a member=n/a cookie=4294967295 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Bus n/a: changing state HELLO → RUNNING
Sent message type=method_call sender=n/a destination=com.redhat.tuned path=/Tuned interface=com.redhat.tuned.contro member=active_profileq cookie=2 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Got message type=error sender=:1.34 destination=:1.39 path=n/a interface=n/a member=n/a cookie=9 reply_cookie=2 signature=s error-name=org.freedesktop.DBus.Error.UnknownMethod error-message=Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 662, in _message_cb
    (candidate_method, parent_method) = _method_lookup(self, method_name, interface_name)
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 252, in _method_lookup
    raise UnknownMethodException('%s is not a valid method of interface %s' % (method_name, dbus_interface))
dbus.exceptions.UnknownMethodException: org.freedesktop.DBus.Error.UnknownMethod: Unknown method: active_profileq is not a valid method of interface com.redhat.tuned.contro
Call failed: Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 662, in _message_cb
    (candidate_method, parent_method) = _method_lookup(self, method_name, interface_name)
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 252, in _method_lookup
    raise UnknownMethodException('%s is not a valid method of interface %s' % (method_name, dbus_interface))
dbus.exceptions.UnknownMethodException: org.freedesktop.DBus.Error.UnknownMethod: Unknown method: active_profileq is not a valid method of interface com.redhat.tuned.contro
Bus n/a: changing state RUNNING → CLOSED

I'm not sure if that's expected behavior or not, so reassigning to tuned folks.

Comment 2 Frantisek Sumsal 2023-01-10 12:12:41 UTC
You can also trigger the same traceback using the dbus-send utility:

# dbus-send --print-reply --system --type=method_call --dest=com.redhat.tuned /Tuned com.redhat.tuned.contro.active_profileq 
Error org.freedesktop.DBus.Error.UnknownMethod: Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 662, in _message_cb
    (candidate_method, parent_method) = _method_lookup(self, method_name, interface_name)
  File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 252, in _method_lookup
    raise UnknownMethodException('%s is not a valid method of interface %s' % (method_name, dbus_interface))
dbus.exceptions.UnknownMethodException: org.freedesktop.DBus.Error.UnknownMethod: Unknown method: active_profileq is not a valid method of interface com.redhat.tuned.contro

Comment 3 Robin Hack 2023-01-10 12:35:28 UTC
(In reply to Frantisek Sumsal from comment #2)
> You can also trigger the same traceback using the dbus-send utility:
> 
> # dbus-send --print-reply --system --type=method_call
> --dest=com.redhat.tuned /Tuned com.redhat.tuned.contro.active_profileq 
> Error org.freedesktop.DBus.Error.UnknownMethod: Traceback (most recent call
> last):
>   File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 662, in
> _message_cb
>     (candidate_method, parent_method) = _method_lookup(self, method_name,
> interface_name)
>   File "/usr/lib64/python3.9/site-packages/dbus/service.py", line 252, in
> _method_lookup
>     raise UnknownMethodException('%s is not a valid method of interface %s'
> % (method_name, dbus_interface))
> dbus.exceptions.UnknownMethodException:
> org.freedesktop.DBus.Error.UnknownMethod: Unknown method: active_profileq is
> not a valid method of interface com.redhat.tuned.contro

Yes. I reported bug to dbus-send too.

Ok. So tuned it is. Thanks.

Comment 4 Robin Hack 2023-01-10 12:37:05 UTC
*** Bug 2159665 has been marked as a duplicate of this bug. ***

Comment 5 Robin Hack 2023-01-10 12:38:41 UTC
Another way how to reproduce:

# dbus-send --system --print-reply --type=method_call --dest='com.redhat.tuned' '/Tuned' com.redhat.tuned.control.list_profiles
(list_profiles is nonsense here)

Comment 6 Jaroslav Škarvada 2023-01-12 01:04:06 UTC
Yep it's not traceback from the application using the TuneD D-Bus API but the way how the D-Bus library used by TuneD handles errors. For some reason the developers of the library thought that handling errors by tracebacks and sending these tracebacks through the D-Bus is a good idea. This maybe useful for debugging of bugs in the library, but it's absolutely useless in production and can be confusing for users, i.e. the user of the application which uses TuneD D-Bus API doesn't need to know that the UnknownMethod error was handled by the line 659 of the service.py. All what does she or he needs to know is that they misused the API and called non existent method.

Unfortunately, it doesn't seem there is a simple way how to disable this behavior. I have to use hackish approach with monkey patching of the D-Bus library. Now it only returns tracebacks if TuneD is running in the debug mode. It now also works with the type errors and others, e.g.:

# dbus-send --system --print-reply --type=method_call --dest='com.redhat.tuned' '/Tuned' com.redhat.tuned.control.switch_profile
Error org.freedesktop.DBus.Python.TypeError: TypeError: switch_profile() missing 1 required positional argument: 'profile_name'

I.e. the switch_profile takes argument which the caller didn't provide.

And when the TuneD daemon is running in the debug mode:
# dbus-send --system --print-reply --type=method_call --dest='com.redhat.tuned' '/Tuned' com.redhat.tuned.control.switch_profile
Error org.freedesktop.DBus.Python.TypeError: Traceback (most recent call last):
  File "/usr/lib64/python3.11/site-packages/dbus/service.py", line 712, in _message_cb
    retval = candidate_method(self, *args, **keywords)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: switch_profile() missing 1 required positional argument: 'profile_name'

Upstream PR:
https://github.com/redhat-performance/tuned/pull/489

Comment 9 Jaroslav Škarvada 2023-02-08 15:29:48 UTC
Upstream PR:
https://github.com/redhat-performance/tuned/pull/489

Comment 19 errata-xmlrpc 2023-05-09 08:26:31 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 (tuned 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:2585


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