Bug 2192842

Summary: [abrt] setroubleshoot: _handle_method_error(): handler.py:497:_handle_method_error:dasbus.error.DBusError: Remote peer disconnected ; 10s idle timer interrupts pending D-Bus calls
Product: Red Hat Enterprise Linux 9 Reporter: Petr Lautrbach <plautrba>
Component: setroubleshootAssignee: Petr Lautrbach <plautrba>
Status: CLOSED MIGRATED QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.2CC: lvrabec, mmalik, mpitt, plautrba, vmojzis
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/d0057d33170aa8fe8bd3f5406639a61e60693225
Whiteboard: abrt_hash:f5cea9a878da677bfd38ac1c4269db5324ac6f47; CockpitTest
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-27 11:03:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Lautrbach 2023-05-03 09:37:28 UTC
+++ This bug was initially created as a clone of Bug #2112573 +++

Version-Release number of selected component:
setroubleshoot-3.3.30-1.fc36

Additional info:
reporter:       libreport-2.17.1
cgroup:         0::/user.slice/user-1001.slice/user/app.slice/app-sealertauto
cmdline:        /usr/bin/python3 -Es /usr/bin/seapplet
crash_function: _handle_method_error
exception_type: dasbus.error.DBusError
executable:     /usr/bin/seapplet
interpreter:    python3-3.10.5-2.fc36.x86_64
kernel:         5.18.13-200.fc36.x86_64
runlevel:       N 5
type:           Python3
uid:            1001

Truncated backtrace:
handler.py:497:_handle_method_error:dasbus.error.DBusError: Remote peer disconnected

Traceback (most recent call last):
  File "/usr/bin/seapplet", line 165, in <module>
    my = SEApplet()
  File "/usr/bin/seapplet", line 68, in __init__
    Setroubleshootd.alert.connect(self.send_notification)
  File "/usr/lib/python3.10/site-packages/dasbus/client/proxy.py", line 161, in __getattr__
    member = self._get_member(self._get_interface(name), name)
  File "/usr/lib/python3.10/site-packages/dasbus/client/proxy.py", line 211, in _get_interface
    self._handler.specification.members
  File "/usr/lib/python3.10/site-packages/dasbus/client/handler.py", line 206, in specification
    self._specification = self._get_specification()
  File "/usr/lib/python3.10/site-packages/dasbus/client/handler.py", line 326, in _get_specification
    xml = self._call_method(
  File "/usr/lib/python3.10/site-packages/dasbus/client/handler.py", line 444, in _call_method
    return self._get_method_reply(
  File "/usr/lib/python3.10/site-packages/dasbus/client/handler.py", line 477, in _get_method_reply
    return self._handle_method_error(error)
  File "/usr/lib/python3.10/site-packages/dasbus/client/handler.py", line 497, in _handle_method_error
    raise exception from None
dasbus.error.DBusError: Remote peer disconnected

Local variables in innermost frame:
self: <dasbus.client.handler.ClientObjectHandler object at 0x7f0d992f3880>
error: GLib.Error('GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected', 'g-dbus-error-quark', 4)
name: 'org.freedesktop.DBus.Error.NoReply'
cls: <class 'dasbus.error.DBusError'>
message: 'Remote peer disconnected'
exception: DBusError('Remote peer disconnected')

Potential duplicate: bug 1987032

--- Additional comment from Alexander Fritz on 2022-07-30 20:33:22 CEST ---



--- Additional comment from Alexander Fritz on 2022-07-30 20:33:23 CEST ---



--- Additional comment from Alexander Fritz on 2022-07-30 20:33:24 CEST ---



--- Additional comment from Alexander Fritz on 2022-07-30 20:33:25 CEST ---



--- Additional comment from Alexander Fritz on 2022-07-30 20:33:26 CEST ---



--- Additional comment from Alexander Fritz on 2022-07-30 20:33:27 CEST ---



--- Additional comment from  on 2022-08-01 09:29:39 CEST ---

Similar problem has been detected:

Happened soon after boot.

reporter:       libreport-2.17.1
cgroup:         0::/user.slice/user-1000.slice/user/app.slice/app-gnome-sealertauto-2543.scope
cmdline:        /usr/bin/python3 -Es /usr/bin/seapplet
crash_function: _handle_method_error
exception_type: dasbus.error.DBusError
executable:     /usr/bin/seapplet
interpreter:    python3-3.10.5-2.fc36.x86_64
kernel:         5.18.13-200.fc36.x86_64
package:        setroubleshoot-3.3.30-1.fc36
reason:         handler.py:497:_handle_method_error:dasbus.error.DBusError: Remote peer disconnected
runlevel:       N 5
type:           Python3
uid:            1000

--- Additional comment from robert fairbrother on 2023-01-31 17:10:54 CET ---



--- Additional comment from Martin Pitt on 2023-04-19 10:46:58 CEST ---



--- Additional comment from Martin Pitt on 2023-04-19 10:46:59 CEST ---



--- Additional comment from Martin Pitt on 2023-04-19 10:47:13 CEST ---



--- Additional comment from Martin Pitt on 2023-04-19 10:51:01 CEST ---

We get this problem a lot in Cockpit's tests, see https://github.com/cockpit-project/cockpit/pull/18670#issuecomment-1514359163 . We see it in Fedora 37/38 and RHEL/CentOS 8 at least. I took the liberty to close some dupicates.

This journal [1] probably has the best explanation what happens:

Apr 18 18:22:30 centos-8-stream-127-0-0-2-2201 setroubleshoot[2962]: AnalyzeThread.run(): Set alarm timeout to 10
Apr 18 18:22:39 centos-8-stream-127-0-0-2-2201 dbus-daemon[779]: [system] Activating service name='org.fedoraproject.SetroubleshootFixit' requested by ':1.37' (uid=0 pid=1454 comm="/usr/bin/python3 /usr/local/bin/cockpit-bridge --p" label="unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023") (using servicehelper)
Apr 18 18:22:40 centos-8-stream-127-0-0-2-2201 dbus-daemon[779]: [system] Successfully activated service 'org.fedoraproject.SetroubleshootFixit'
Apr 18 18:22:40 centos-8-stream-127-0-0-2-2201 org.fedoraproject.SetroubleshootFixit[3015]: ERROR:dbus.proxies:Introspect error on :1.56:/org/fedoraproject/Setroubleshootd: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
Apr 18 18:22:41 centos-8-stream-127-0-0-2-2201 org.fedoraproject.SetroubleshootFixit[3015]: could not attach to desktop process
Apr 18 18:22:41 centos-8-stream-127-0-0-2-2201 systemd[1]: setroubleshootd.service: Succeeded.

I.e. it seems like setroubleshoot has some 10s idle timer, which fires and stops the service although there are pending D-Bus calls.

[1] https://cockpit-logs.us-east-1.linodeobjects.com/pull-18661-20230418-173000-028eaf96-centos-8-stream-pybridge/TestSelinux-testTroubleshootAlerts-centos-8-stream-127.0.0.2-2801-FAIL.log.gz

--- Additional comment from Petr Lautrbach on 2023-04-19 11:16:13 CEST ---

Thanks, the log is useful.

Yes, there's a timeout to stop the service when there's no request. But it looks like it does not work correctly with org.fedoraproject.SetroubleshootFixit. I'll work on it.