Bug 1608417

Summary: DeprecationWarning: Importing dbus.glib to use the GLib main loop with dbus-python is deprecated
Product: [Fedora] Fedora Reporter: Lukas Slebodnik <lslebodn>
Component: setroubleshootAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: christian.hardy, dwalsh, edgar.hoch, keesdejong+dev, plautrba, redhat, sixpack13, vmojzis
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: setroubleshoot-3.3.20-2.fc29 setroubleshoot-3.3.20-3.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-06 12:58:48 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:
Embargoed:

Description Lukas Slebodnik 2018-07-25 13:38:49 UTC
Description of problem:
I noticed following warning on rawhide when using sealer from command line

/usr/bin/sealert:32: DeprecationWarning: Importing dbus.glib to use the GLib main loop with dbus-python is deprecated.
Instead, use this sequence:

    from dbus.mainloop.glib import DBusGMainLoop

    DBusGMainLoop(set_as_default=True)

  import dbus.glib

Version-Release number of selected component (if applicable):
sh# rpm -q setroubleshoot-server python3-dbus
setroubleshoot-server-3.3.18-1.fc29.x86_64
python3-dbus-1.2.8-3.fc29.x86_64

How reproducible:
Deterministic

Steps to Reproduce:
1. dnf install -y setroubleshoot-server
2. service restart auditd
3. //generate some AVC (which is usually not a problem on rawhide)
4. check journald and run sealer mentioned in log

Actual results:
sh# sealert -l ae6d58d2-8403-446f-b499-66f52db07bc8
/usr/bin/sealert:32: DeprecationWarning: Importing dbus.glib to use the GLib main loop with dbus-python is deprecated.
Instead, use this sequence:

    from dbus.mainloop.glib import DBusGMainLoop

    DBusGMainLoop(set_as_default=True)

  import dbus.glib
SELinux is preventing cat from 'read, write' accesses on the chr_file /1
//snip

Expected results:
No deprecated warnings in output

Additional info:

Comment 1 Jan Kurik 2018-08-14 08:41:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 2 sixpack13 2018-11-13 05:15:10 UTC
same here.

maybe an easier way to reproduce: just start "SElinux Trubleshooter" from your apps

Comment 3 Christian Kujau 2019-08-09 19:53:44 UTC
Still happening on F30:


$ rpm -qf `which sealert`
setroubleshoot-server-3.3.20-1.fc30.x86_64


$ sealert -l 4f92593e-0120-4988-b9ad-1e43764e86c5 > /dev/null 
/usr/bin/sealert:32: DeprecationWarning: Importing dbus.glib to use the GLib main loop with dbus-python is deprecated.
Instead, use this sequence:

    from dbus.mainloop.glib import DBusGMainLoop

    DBusGMainLoop(set_as_default=True)

  import dbus.glib



The following would make this warning go away, but I don't know if this is The Right Thing To Do:

$ diff -u /usr/bin/sealert{.orig,}
--- /usr/bin/sealert.orig       2019-07-26 02:02:06.000000000 -0700
+++ /usr/bin/sealert    2019-08-09 12:51:31.271212450 -0700
@@ -29,7 +29,6 @@
 GLib.set_prgname('setroubleshoot')
 
 import dbus
-import dbus.glib
 import dbus.service
 import errno as Errno
 import gettext
@@ -42,6 +41,9 @@
 import sys
 import slip.dbus.service
 
+from dbus.mainloop.glib import DBusGMainLoop
+DBusGMainLoop(set_as_default=True)
+
 from setroubleshoot.config import parse_config_setting, get_config
 domain = get_config('general', 'i18n_text_domain')
 kwargs = {}

Comment 4 Edgar Hoch 2019-08-19 00:45:20 UTC
This bug report exists since about a year. There was updated packages released in the meantime, but this problem was not fixed in the updated packages.
Please fix it in the next updated package. sealert still fails in Fedora 30.

Comment 5 Fedora Update System 2019-08-28 08:03:59 UTC
FEDORA-2019-8147bfe299 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-8147bfe299

Comment 6 Fedora Update System 2019-08-28 08:30:35 UTC
FEDORA-2019-a33fc91747 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-a33fc91747

Comment 7 Fedora Update System 2019-08-29 21:01:35 UTC
setroubleshoot-3.3.20-3.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-8147bfe299

Comment 8 Fedora Update System 2019-08-30 00:25:37 UTC
setroubleshoot-3.3.20-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-a33fc91747

Comment 9 Fedora Update System 2019-09-06 12:58:48 UTC
setroubleshoot-3.3.20-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2019-09-14 00:06:36 UTC
setroubleshoot-3.3.20-3.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2019-09-14 16:30:52 UTC
setroubleshoot-3.3.20-3.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.