Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1574434

Summary: sealert -s / -S tracebacks when display is set to VNC server
Product: Red Hat Enterprise Linux 8 Reporter: Milos Malik <mmalik>
Component: setroubleshootAssignee: Vit Mojzis <vmojzis>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: lvrabec, mmalik, plautrba, vmojzis
Target Milestone: rcKeywords: AutoVerified, Triaged
Target Release: 8.3Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1484754 Environment:
Last Closed: 2020-11-04 03:19:38 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:
Bug Depends On: 1682463    
Bug Blocks:    

Description Milos Malik 2018-05-03 10:35:59 UTC
+++ This bug was initially created as a clone of Bug #1484754 +++

Description of problem:

Version-Release number of selected component (if applicable):
setroubleshoot-3.3.17-1.el8+5.x86_64
setroubleshoot-plugins-3.3.9-3.el8+5.noarch
setroubleshoot-server-3.3.17-1.el8+5.x86_64
tigervnc-license-1.8.0-5.el8+5.noarch
tigervnc-server-1.8.0-5.el8+5.x86_64
tigervnc-server-minimal-1.8.0-5.el8+5.x86_64

How reproducible:
* always

Steps to Reproduce:
# mkdir .vnc
# echo "P4ss${RANDOM}w0rD" > ~/.vnc/passwd
# chmod 600 .vnc/passwd 
# vncserver 

New 'removed:1 (root)' desktop is removed:1

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/removed:1.log

# export DISPLAY=removed:1
# LANG=de_DE sealert -s
Unable to init server: Could not connect: Connection refused
Unable to init server: Verbindung ist gescheitert: Connection refused
Opps, sealert hit an error!

Traceback (most recent call last):
  File "/usr/bin/sealert", line 659, in <module>
    run_as_dbus_service(username)
  File "/usr/bin/sealert", line 118, in run_as_dbus_service
    app = SEAlert(user, dbus_service.presentation_manager, watch_setroubleshootd=True)
  File "/usr/bin/sealert", line 351, in __init__
    self.browser = BrowserApplet(self.username, self.alert_client, domain=domain)
  File "/usr/lib/python3.6/site-packages/setroubleshoot/browser.py", line 182, in __init__
    size = Gdk.Screen().get_default().get_monitor_geometry(0)
AttributeError: 'NoneType' object has no attribute 'get_monitor_geometry'

# ps -efZ | grep setr
system_u:system_r:setroubleshootd_t:s0-s0:c0.c1023 setroub+ 2883 1  0 06:26 ? 00:00:00 /usr/bin/python3 -Es /usr/sbin/setroubleshootd -f
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 root 2891 1060  0 06:31 pts/0 00:00:00 grep --color=auto setr
# ls -Z /run/setroubleshoot/
system_u:object_r:setroubleshoot_var_run_t:s0 setroubleshoot_server
# ls -lZ /run/setroubleshoot/
total 0
srw-rw-rw-. 1 setroubleshoot setroubleshoot system_u:object_r:setroubleshoot_var_run_t:s0 0 May  3 06:27 setroubleshoot_server
# LANG=de_DE sealert -S
Unable to init server: Could not connect: Connection refused
Unable to init server: Verbindung ist gescheitert: Connection refused
Opps, sealert hit an error!

Traceback (most recent call last):
  File "/usr/bin/sealert", line 668, in <module>
    run_app(username)
  File "/usr/bin/sealert", line 95, in run_app
    app = SEAlert(user)
  File "/usr/bin/sealert", line 351, in __init__
    self.browser = BrowserApplet(self.username, self.alert_client, domain=domain)
  File "/usr/lib/python3.6/site-packages/setroubleshoot/browser.py", line 182, in __init__
    size = Gdk.Screen().get_default().get_monitor_geometry(0)
AttributeError: 'NoneType' object has no attribute 'get_monitor_geometry'

# 

Actual results:
* tracebacks

Expected results:
* no tracebacks

Additional information:
* the same traceback appears when I run: vncserver -geometry 1024x768

--- Additional comment from Milos Malik on 2017-08-24 05:56:46 EDT ---

The LANG setting is not important, the traceback appears even if default LANG setting is used.

sealert -s / -S works fine when executed inside an SSH terminal to the same machine (ssh -X ... used of course).

Comment 3 Petr Lautrbach 2019-12-10 13:33:29 UTC
I can't reproduce this problem anymore:

# rpm -q setroubleshoot tigervnc-server gtk3
setroubleshoot-3.3.20-2.el8.x86_64
tigervnc-server-1.9.0-11.el8.x86_64
gtk3-3.22.30-5.el8.x86_64

# vncserver

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
xauth:  file /root/.Xauthority does not exist

New 'ci-vm-10-0-137-242.hosted.upshift.rdu2.redhat.com:1 (root)' desktop is ci-vm-10-0-137-242.hosted.upshift.rdu2.redhat.com:1

Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ci-vm-10-0-137-242.hosted.upshift.rdu2.redhat.com:1.log

[root@ci-vm-10-0-137-242 ~]# export DISPLAY=:1

[root@ci-vm-10-0-137-242 ~]# sealert -s &
[1] 5840

(setroubleshoot:5840): Gtk-WARNING **: 08:30:18.859: Could not load a pixbuf from /org/gtk/libgtk/theme/Adwaita/assets/bullet-symbolic.svg.
This may indicate that pixbuf loaders or the mime database could not be found.

[root@ci-vm-10-0-137-242 ~]# ps ax | grep sealert
 5840 pts/0    S      0:00 /usr/libexec/platform-python -Es /usr/bin/sealert -s

Milos, please confirm.

Comment 4 Milos Malik 2019-12-10 15:13:08 UTC
If DISPLAY is set to ":1" then I see the same thing as you do.
If DISPLAY is set to "<machine-name>:1" then the output matches comment#0. The output of "uname -n" is used as <machine-name>.

Comment 5 Petr Lautrbach 2019-12-11 08:35:47 UTC
[root@ci-vm-10-0-138-215 ~]# export DISPLAY=ci-vm-10-0-138-215.hosted.upshift.rdu2.redhat.com:1
[root@ci-vm-10-0-138-215 ~]# xterm -e 'sleep 1'                                               
...
xterm: Xt error: Can't open display: %s
[root@ci-vm-10-0-138-215 ~]# export DISPLAY=:1
[root@ci-vm-10-0-138-215 ~]# xterm -e 'sleep 1'
[root@ci-vm-10-0-138-215 ~]#

Given that `xterm` behaves in the same manner is the report related to the fact that `sealert` can't get information about DISPLAY="<machine-name>:1"? Or is the problem that there's a traceback?  If the former it's not setroubleshoot problem and we need to find the correct component.

Comment 6 Milos Malik 2019-12-11 08:39:35 UTC
I agree. We need to find the correct component. Maybe desktop QE guys can help us.

Comment 18 errata-xmlrpc 2020-11-04 03:19:38 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 (setroubleshoot 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-2020:4725