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 1025706 - virt-manager causes a python trace-back instead of handling the error when it cannot open display
Summary: virt-manager causes a python trace-back instead of handling the error when it...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-manager
Version: 6.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Giuseppe Scrivano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-01 10:58 UTC by Christos Triantafyllidis
Modified: 2015-02-01 23:11 UTC (History)
10 users (show)

Fixed In Version: virt-manager-0.9.0-20.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 06:26:19 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1447 0 normal SHIPPED_LIVE virt-manager bug fix and enhancement update 2014-10-14 01:05:46 UTC

Description Christos Triantafyllidis 2013-11-01 10:58:55 UTC
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 11:31:20 UTC
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 11:54:37 UTC
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 16:58:34 UTC
Cole just pushed a change that seems to have fixed this issue:

commit 395a20edd82f1072d23e80ecbb25dbeed9359304
Author: Cole Robinson <crobinso>
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 09:21:31 UTC
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-05 03:26:59 UTC
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 06:26:19 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, 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.