xpra icon
Bug tracker and wiki

Opened 5 years ago

Closed 5 years ago

#763 closed defect (fixed)

use a more friendly error message when the client is started without a display on *nix

Reported by: Lukas Haase Owned by: Antoine Martin
Priority: minor Milestone:
Component: core Version: 0.14.x
Keywords: Cc:

Description

Suddenly "xpra attach" fails with the recent 0.14.13 stable build from the repository in CentOS 6.

start/upgrade works.

Maybe some dependency is missing now?

$ xpra --version
xpra v0.14.13
$ xpra attach :1985
xpra main error:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/xpra/scripts/main.py", line 103, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/usr/lib64/python2.6/site-packages/xpra/scripts/main.py", line 761, in run_mode
    return run_client(error_cb, options, args, mode)
  File "/usr/lib64/python2.6/site-packages/xpra/scripts/main.py", line 1109, in run_client
    from xpra.platform.gui import init as gui_init
  File "/usr/lib64/python2.6/site-packages/xpra/platform/gui.py", line 70, in <module>
    "system_bell")
  File "/usr/lib64/python2.6/site-packages/xpra/platform/__init__.py", line 114, in platform_import
    platform_module = __import__(module, {}, {}, imports)
  File "/usr/lib64/python2.6/site-packages/xpra/platform/xposix/gui.py", line 12, in <module>
    from xpra.gtk_common.error import trap, XError
  File "/usr/lib64/python2.6/site-packages/xpra/gtk_common/error.py", line 42, in <module>
    gdk = import_gdk()
  File "/usr/lib64/python2.6/site-packages/xpra/gtk_common/gobject_compat.py", line 83, in import_gdk
    return  _try_import(import_gdk3, import_gdk2)
  File "/usr/lib64/python2.6/site-packages/xpra/gtk_common/gobject_compat.py", line 36, in _try_import
    imported = import_method_gtk3()
  File "/usr/lib64/python2.6/site-packages/xpra/gtk_common/gobject_compat.py", line 80, in import_gdk3
    from gi.repository import Gdk                   #@UnresolvedImport
ImportError: No module named gi.repository

Change History (5)

comment:1 Changed 5 years ago by Antoine Martin

Owner: changed from Antoine Martin to Lukas Haase

Looks like it's failing to import pygtk. Nothing has changed in this area for a very long time, so I doubt this is an xpra source or packaging problem.

Try running this from the command line:

python -c "import gtk;import pygtk"

xpra will not work without those. Maybe you have mixed versions, or installed from source previously? If that's the case, try cleaning up everything and re-installing.

Also make sure your python version is python2, and that the /usr/bin/xpra script uses that version and not python3.

Last edited 5 years ago by Antoine Martin (previous) (diff)

comment:2 Changed 5 years ago by Lukas Haase

Actually, it seems that this error appears when no X server is started.
I forgot to start th X server (your proposed command resulted in "RuntimeError?: could not open display").

it's probably a good idea to catch this exception, print a meaningful error message and exit...

comment:3 Changed 5 years ago by Antoine Martin

Owner: changed from Lukas Haase to Antoine Martin
Priority: criticalminor
Status: newassigned
Summary: ImportError: No module named gi.repositoryuse a more friendly error message when the client is started without a display on *nix

Yes, I can get the same error with:

DISPLAY= xpra attach

The problem is that when we fail with pygtk, we try gobject introspection (gi.repository) - this is the error you are seeing.

  1. It's difficult to choose which one to show the user
  2. On many platforms (ie: win32, osx), we may not have a display and yet gtk will load fine..

comment:4 Changed 5 years ago by Antoine Martin

Fix for trunk in r8240, with this change I get:

$ DISPLAY= xpra attach
xpra initialization error: could not open display

Will backport to v0.14.x so keeping this ticket open.

comment:5 Changed 5 years ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Backport in r8254. Closing.

Note: See TracTickets for help on using tickets.