Problem with Graphics n/a on ec2 instance

769 views
Skip to first unread message

Zac Tolley

unread,
Jun 19, 2011, 5:05:26 PM6/19/11
to Jenkins Users
I'm setting up Jenkins so whenever I do a commit Jenkins picks up the
change, runs my unit tests and if they pass builds my war and deploys
it.

I'm also trying to set things up so that a few other things happen,
starting with runnign jslist against my js, codenarc and hopefully
later I'll figure out how to automate the running of my Qunit test
too, but right now I've got a problem.

I've come across the issue that shows the following message in place
of where a graph is expected for violations

Graphics N/A
Unable to access X. You need to run the web container in the headless
mode. Add -Djava.awt.headless=true to VM.

In my cataline.sh I added

-Djava.awt.headless=true


I've seen a few things here and there about this but no clear answer
for amazons own flavour of unix which is based on centos.

Any ideas?

danny staple

unread,
Jun 19, 2011, 6:29:56 PM6/19/11
to jenkins...@googlegroups.com
The other advice I'd give you is to try something like xvfb - a memory only buffer thing for X. We've had to sue it for tests that insist on having it there - and headless wont work.
--
Danny Staple

Director, ODM Solutions Ltd
w: http://www.odmsolutions.co.uk
Blog: http://orionrobots.co.uk/blog1-Danny-Staple


Mark Waite

unread,
Jun 20, 2011, 12:25:13 AM6/20/11
to jenkins...@googlegroups.com
The Xvnc plugin will start an X server for use by your job, then stop it again at the end of the job if your job needs an X server.  I use it quite comfortably on several different Debian variants.

Mark Waite


From: Zac Tolley <z...@thetolleys.com>
To: Jenkins Users <jenkins...@googlegroups.com>
Sent: Sunday, June 19, 2011 3:05 PM
Subject: Problem with Graphics n/a on ec2 instance

Didier Durand

unread,
Jun 20, 2011, 2:03:12 AM6/20/11
to Jenkins Users
Hi Mark,

I have exact same issue: tried your solution but it doesn't work for
me when i do Manage Jenkins > Load Statistics.

So, my question: does this plugin work in all cases where graphics are
needed or only during a build ?

regards

didier

Mark Waite

unread,
Jun 20, 2011, 7:01:46 AM6/20/11
to jenkins...@googlegroups.com
That plugin is only useful during a job.  

If the "Load Statistics" page requires an X server, then I think that will need some other solution.  

You could consider changing the way Jenkins is launched on the slave node so that before Java is executed the script runs "vncserver".  I think it is a bug if the core of Jenkins requires an X server.

I am a little surprised that you're seeing that problem, though, since my Jenkins instance does not have an X server available all the time, and my "Load Statistics" page appears correctly, and renders its graphics correctly.  I'm not running on an EC2 instance (using a local computer), and I'm running Debian rather than CentOS.

Mark Waite


From: Didier Durand <durand...@gmail.com>
To: Jenkins Users <jenkins...@googlegroups.com>
Sent: Monday, June 20, 2011 1:03 AM
Subject: Re: Problem with Graphics n/a on ec2 instance

Zac Tolley

unread,
Jun 20, 2011, 7:49:39 AM6/20/11
to jenkins...@googlegroups.com
It seems there are 2 related issues that people see. One case where a part of the build process needs to do some graphical work, the other is within Jenkins for more general browsing around stuff (technical eh)


My immediate issue is when I run a build I produce test results, if I then goto the build, click on test results and click on history I get the error.

I've seen it for codenarc too but I'm not sure if that is produced at build time or what... 

Surely someone has seen this before?

Didier Durand

unread,
Jun 20, 2011, 1:05:47 PM6/20/11
to Jenkins Users
@Marc,

The node where I need X-Server is not a slave but the master.

Any suggestion ?

I have seen this on the wiki but I am not sure that it is related to
my problem: https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+got+java.awt.headless+problem.
Does it mean that I should install the equivalent of this "DejaVu"
font package on my EC2 instance to solve my problem?

regards

didier

Mark Waite

unread,
Jun 20, 2011, 10:51:19 PM6/20/11
to jenkins...@googlegroups.com
Since that description seems very similar to your failure, I think it is worth the attempt to see if it will fix the problem.
 
Mark Waite

From: Didier Durand <durand...@gmail.com>
To: Jenkins Users <jenkins...@googlegroups.com>
Sent: Monday, June 20, 2011 12:05 PM
Subject: Re: Problem with Graphics n/a on ec2 instance

Zac Tolley

unread,
Jun 21, 2011, 8:55:30 AM6/21/11
to jenkins...@googlegroups.com
I fixed in the end. I tried installing fonts, nothing, I tried installing x files, nothing... 

I installed the Sun JDK and switched from Open JDK to that.

BAM 

Graphs :)
Reply all
Reply to author
Forward
0 new messages