This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1025706 - virt-manager causes a python trace-back instead of handling the error when it cannot open display
virt-manager causes a python trace-back instead of handling the error when it...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-manager (Show other bugs)
6.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Giuseppe Scrivano
Virtualization Bugs
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-01 06:58 EDT by Christos Triantafyllidis
Modified: 2015-02-01 18:11 EST (History)
10 users (show)

See Also:
Fixed In Version: virt-manager-0.9.0-20.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-10-14 02:26:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Replaces raise with print + sys.exit (495 bytes, patch)
2013-11-01 07:31 EDT, Christos Triantafyllidis
no flags Details | Diff

  None (edit)
Description Christos Triantafyllidis 2013-11-01 06:58:55 EDT
Description of problem:
If when executed virt-manager via ssh there is no x-forwarding enabled virt-manager (as expected) fails to execute. Instead of handling this error it prints the python traceback:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager.py", line 383, in <module>
    main()
  File "/usr/share/virt-manager/virt-manager.py", line 286, in main
    raise gtk_error
RuntimeError: could not open display

This causes abrt daemon to run (if it is configured) and that causes additional (unneeded) load / issues as it executes sosreport in the background.

Version-Release number of selected component (if applicable):
virt-manager-0.9.0-18.el6.x86_64

How reproducible:
Everytime

Steps to Reproduce:
1. Install virt-manager
2. Connect to that host via ssh without X forwarding
3. Execute virt-manager

Actual results:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager.py", line 383, in <module>
    main()
  File "/usr/share/virt-manager/virt-manager.py", line 286, in main
    raise gtk_error
RuntimeError: could not open display

Expected results:
Any handling of the error that would print a normal user friendly error message i.e.:
"There is no display available to execute virt-manager. DISPLAY is not set."

Additional info:
Comment 1 Christos Triantafyllidis 2013-11-01 07:31:20 EDT
Created attachment 818257 [details]
Replaces raise with print + sys.exit

(Ugly) patch that workarounds the issue.

Simple replaces the raise with "print + sys.exit"
Comment 2 Giuseppe Scrivano 2013-11-01 07:54:37 EDT
I don't think virt-manager should try to intercept this error and try to guess the reason why it fails.  The "RuntimeError: could not open display" error message is raised by GTK and if it has to be improved, it should definitely be done there.

I am not sure we want to drop the stack-trace, I am personally inclined to keep it as it is, the stack-trace is very helpful when it comes to troubleshoot problems.


All graphical applications I have tried, are affected by this problem:

$ LANG=C DISPLAY= pidgin

(Pidgin:20168): Gdk-CRITICAL **: IA__gdk_display_get_name: assertion `GDK_IS_DISPLAY (display)' failed
Pidgin 2.10.7-3.fc19

** (Pidgin:20168): WARNING **: cannot open display: unset


$ LANG=C DISPLAY= firefox

(process:20169): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Error: cannot open display: 


$ LANG=C DISPLAY= chromium-browser

(chromium-browser:20185): Gtk-WARNING **: cannot open display: 


$ LANG=C DISPLAY= gimp
Cannot open display: 

Please reopen if you disagree with me.
Comment 4 Giuseppe Scrivano 2013-11-01 12:58:34 EDT
Cole just pushed a change that seems to have fixed this issue:

commit 395a20edd82f1072d23e80ecbb25dbeed9359304
Author: Cole Robinson <crobinso@redhat.com>
Date:   Fri Nov 1 09:44:14 2013 -0400

    virt-manager: Yet more fixes for DISPLAY unset error
    
    Since these days we have to import Gtk _after_ forking, _and_ Gtk
    doesn't raise a nice error for us, we need to postpone dropping stdio
    so the user has any chance of seeing the error. Also try to add an
    explicit error about DISPLAY again, since we don't get it from Gtk
    these days.


It has the side effect of dropping the python trace-back you had before.  Can you please confirm it?
Comment 5 hyao@redhat.com 2013-11-18 04:21:31 EST
I can reproduce with 
#  rpm -qa virt-manager
virt-manager-0.9.0-19.el6.x86_64


# virt-manager
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager.py", line 383, in <module>
    main()
  File "/usr/share/virt-manager/virt-manager.py", line 286, in main
    raise gtk_error
RuntimeError: could not open display

I'll try again once the new package available on rhel6.
Comment 8 Cui Lei 2014-05-04 23:26:59 EDT
I can reproduce this issue with virt-manager-0.9.0-19.el6.x86_64 like comment5.

Verify this issue with:
virt-manager-0.9.0-20.el6.x86_64
python-virtinst-0.600.0-20.el6.noarch
libvirt-0.10.2-29.el6_5.7.x86_64

Steps:
1. From a remote host, Connect to that host via ssh without X forwarding
2. Execute virt-manager

Results:
# virt-manager
Unable to initialize GTK: could not open display

virt-manager handle the error when it cannot open display, and python track-back did not display.

So change the status from 'QN_QA' to 'VERIFIED'
BTW, remove the needinfo as Christos needinfo himself, as a reporter, he should clear the bug and see the verify result.
Comment 9 errata-xmlrpc 2014-10-14 02:26:19 EDT
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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1447.html

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