← Back to team overview

yade-dev team mailing list archive

[Bug 1223348] [NEW] Yade starts without graphical interface

 

Public bug reported:

Today I stumbled upon a bug in the startup script of Yade[1]. In my eyes
this bug won't affect a lot of people.

I created a new user User1 on our Yade-Server. This user will run yade via remote connection (from ubuntu 12.04 LTS using rdesktop).
(To be more precise the setup is that: windows XP 32 bit dektop computer -> VirtualBox virtual machine using Ubuntu 12.04 LTS 32bit -> Yade-Server)

Starting Yade-Daily as User1 ends up in the noGui Version of Yade. You can start Yade in this version using the -n argument at startup:
yade-daily -n

There is no error message or warning. You just wont be able to start the qtController or 3D View.
According to [1]l ines 233-250 this will happen, if gui is not part of "features". After calling features in yade this could be declined. Checking yade.runtime.hasDisplay gives False. So it was obvious that an error was raised during Xlib.display._BaseDisplay().
After starting a python console and importing the Xlib module, a call of Xlib.display._BaseDisplay() ends up in an error [2]
I simply created an empty .Xauthority file:
touch ~/.Xauthority

After this things worked as they were expected to.

I'm not sure whether this solution can somehow be implemented at the
startup of yade. At least a Warning should be raised if graphics are
disabled. The Xauthority thing is mentioned in the comments but the user
should be informed, too.

--------------
[1]https://github.com/yade/trunk/blob/master/core/main/main.py.in
especially lines 233-250:
"## run userSession in a way corresponding to the features we use:
gui=None
yade.runtime.hasDisplay=False # this is the default initialized in the module, anyway
if 'qt4' in features: gui='qt4'
if opts.nogui: gui=None
if gui:
	import Xlib.display
	# PyQt4's QApplication does exit(1) if it is unable to connect to the display
	# we however want to handle this gracefully, therefore
	# we test the connection with bare xlib first, which merely raises DisplayError
	try:
		# contrary to display.Display, _BaseDisplay does not check for extensions and that avoids spurious message "Xlib.protocol.request.QueryExtension" (bug?)
		Xlib.display._BaseDisplay();
		yade.runtime.hasDisplay=True
	except: 
		# usually Xlib.error.DisplayError, but there can be Xlib.error.XauthError etc as well
		# let's just pretend any exception means the display would not work
		gui=None
"

[2] to be added later

** Affects: yade
     Importance: Low
         Status: In Progress


** Tags: forwarding rdesktop x11 xauthority xlib

-- 
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.
https://bugs.launchpad.net/bugs/1223348

Title:
  Yade starts without graphical interface

Status in Yet Another Dynamic Engine:
  In Progress

Bug description:
  Today I stumbled upon a bug in the startup script of Yade[1]. In my
  eyes this bug won't affect a lot of people.

  I created a new user User1 on our Yade-Server. This user will run yade via remote connection (from ubuntu 12.04 LTS using rdesktop).
  (To be more precise the setup is that: windows XP 32 bit dektop computer -> VirtualBox virtual machine using Ubuntu 12.04 LTS 32bit -> Yade-Server)

  Starting Yade-Daily as User1 ends up in the noGui Version of Yade. You can start Yade in this version using the -n argument at startup:
  yade-daily -n

  There is no error message or warning. You just wont be able to start the qtController or 3D View.
  According to [1]l ines 233-250 this will happen, if gui is not part of "features". After calling features in yade this could be declined. Checking yade.runtime.hasDisplay gives False. So it was obvious that an error was raised during Xlib.display._BaseDisplay().
  After starting a python console and importing the Xlib module, a call of Xlib.display._BaseDisplay() ends up in an error [2]
  I simply created an empty .Xauthority file:
  touch ~/.Xauthority

  After this things worked as they were expected to.

  I'm not sure whether this solution can somehow be implemented at the
  startup of yade. At least a Warning should be raised if graphics are
  disabled. The Xauthority thing is mentioned in the comments but the
  user should be informed, too.

  --------------
  [1]https://github.com/yade/trunk/blob/master/core/main/main.py.in
  especially lines 233-250:
  "## run userSession in a way corresponding to the features we use:
  gui=None
  yade.runtime.hasDisplay=False # this is the default initialized in the module, anyway
  if 'qt4' in features: gui='qt4'
  if opts.nogui: gui=None
  if gui:
  	import Xlib.display
  	# PyQt4's QApplication does exit(1) if it is unable to connect to the display
  	# we however want to handle this gracefully, therefore
  	# we test the connection with bare xlib first, which merely raises DisplayError
  	try:
  		# contrary to display.Display, _BaseDisplay does not check for extensions and that avoids spurious message "Xlib.protocol.request.QueryExtension" (bug?)
  		Xlib.display._BaseDisplay();
  		yade.runtime.hasDisplay=True
  	except: 
  		# usually Xlib.error.DisplayError, but there can be Xlib.error.XauthError etc as well
  		# let's just pretend any exception means the display would not work
  		gui=None
  "

  [2] to be added later

To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/1223348/+subscriptions


Follow ups

References