Bug 1574434 - sealert -s / -S tracebacks when display is set to VNC server
Summary: sealert -s / -S tracebacks when display is set to VNC server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: setroubleshoot
Version: 8.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.3
Assignee: Vit Mojzis
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On: 1682463
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-03 10:35 UTC by Milos Malik
Modified: 2020-11-04 03:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of: 1484754
Environment:
Last Closed: 2020-11-04 03:19:38 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4725 0 None None None 2020-11-04 03:19:44 UTC

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


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