Opened 3 years ago

Closed 3 years ago

Last modified 18 months ago

#408 closed defect (fixed)

jrobin graphs do not appear on a headless server

Reported by: Mathiasdm Owned by: Mathiasdm
Priority: trivial Milestone: 0.8.4
Component: apps/console Version: 0.8.3
Keywords: Cc:
Parent Tickets:

Description

Due to the addition of desktopgui, which requires headless to be off in the JVM, jrobin graphs do not appear on a headless server.

Subtickets

Change History (6)

comment:1 Changed 3 years ago by Mathiasdm

  • Status changed from new to accepted

comment:2 Changed 3 years ago by Mathiasdm

Root cause: during boot, the 'headless' setting in the JVM is set to true, instead of a check being performed to make sure we're in a headless environment.

Desktopgui initially worked around this by setting headless to false, but this broke in headless environments. Setting headless to true after initializing desktopgui was also not a solution. This is because GraphicsEnvironment? is (I think) a singleton. As such, desktopgui causes a non-headless GraphicsEnvironment? to be loaded. When jrobin tries to load an environment, it will get the same singleton and crash.

The actual fix (currently under test) is to determine if we are in headless or non-headless mode.
This can be done by setting headless to false and requesting a GraphicsEnvironment?. If this fails, we can set a 'headless' property in I2P to true (and in the other case, to false). Then, we need to reboot (to get rid of the singleton GraphicsEnvironment?).
Based on the property, we can then set the 'headless' property correctly.

comment:3 Changed 3 years ago by zzz

  • Component changed from unspecified to apps/console
  • Priority changed from major to blocker

comment:4 Changed 3 years ago by Mathiasdm

  • Resolution set to fixed
  • Status changed from accepted to closed

Fixed in -10, as explained in my previous comment.

comment:5 Changed 3 years ago by Mathiasdm

Fixed cleanly (without requiring I2P restart) in -11.

comment:6 Changed 18 months ago by guest

  • Priority changed from blocker to trivial

Im adding the following for future reference as this might be a faq topic for others:

If you arent getting graphs on a headless installation of i2p it is because you are missing some needed libraries for x11 interfaces to java. To solve this you will need to find out what is missing.
ldd $JAVA_HOME/jre/lib/$ARCH/xawt/libmawt.so

example:
ldd /usr/lib/jvm/java-7-openjdk/jre/lib/amd64/xawt/libmawt.so | grep 'not found'

depending on how useful your distros package manager is, you should be able to find what package provides what library.

In my case i was missing libXi.so and libgtk-x11-2.0.so which was provided by my distros 'gtk' package. And presto graphs working!
Hope this helps.

Note: See TracTickets for help on using tickets.