Jenkins cannot connect to X server on Debain 7.1

442 views
Skip to first unread message

Fatemeh Mehdizadeh

unread,
Mar 29, 2014, 12:41:38 AM3/29/14
to jenkins...@googlegroups.com
Hi all,

My test on jenkins is failing because jenkins can't connect to the x server on my Debian machine. In my job configuration I set Build--->Execute shell----> and in command section I typed:

bash -l -c "rm -rf router/reports/*.pdf"
echo $WORKSPACE > workspace_place
bash -l -c "nosetests -w router --with-xunit"

When I build the job it says:
nosetests: cannot connect to X server

My tcp connection is enabled, when I run netstat -nal | grep 6000 the output is:

tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp6 0 0 :::6000 :::* LISTEN

and also in terminal I typed:
xhost localhost

I don't Know what should i do, please help me.

Thanks

Daniel Beck

unread,
Mar 29, 2014, 7:16:45 AM3/29/14
to jenkins...@googlegroups.com
I'd try comparing the output of the `env` command in your terminal and in the Jenkins job to see whether relevant environment variables need to be defined in the job.
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Mark Waite

unread,
Mar 29, 2014, 8:23:35 AM3/29/14
to jenkins...@googlegroups.com
Are you using the Xvnc plugin, or assuming the ability to connect to another X server?  You may find it easier to use the Xvnc plugin and let Jenkins start and stop an X server for the jobs.

If you're already using the Xvnc plugin, then you might consider checking that you can connect to the X server from the command line as the Jenkins user.  Login as the jenkins user, set the DISPLAY variable (DISPLAY=:0) and start an xterm command.

Mark Waite
--
Thanks!
Mark Waite

Fatemeh Mehdizadeh

unread,
Mar 31, 2014, 1:06:14 AM3/31/14
to jenkins...@googlegroups.com
Thank you for your attension,

I'm not using Xvnc plugin. I still have the error:
in job configuration: set Build--->Execute shell----> and in command section I typed:


bash -l -c "rm -rf router/reports/*.pdf"
echo $WORKSPACE > workspace_place
bash -l -c "nosetests -w router --with-xunit"

When I build the job it says:
nosetests: cannot connect to X server

Dirk Heinrichs

unread,
Mar 31, 2014, 1:35:36 AM3/31/14
to jenkins...@googlegroups.com
Am 31.03.2014 07:06, schrieb Fatemeh Mehdizadeh:

I'm not using Xvnc plugin.

Then you should do so. Jenkins is a daemon, and as such doesn't know anything about X. With the Xvnc or Xvfb plugin, Jenkins can start a virtual X server itself. This will then be used to run your X clients.

HTH...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Fatemeh Mehdizadeh

unread,
Mar 31, 2014, 2:02:46 AM3/31/14
to jenkins...@googlegroups.com
I install Xvnc plugin, when I build my test has errors:
Starting xvnc
[workspace] $ vncserver :52 -localhost -nolisten tcp
FATAL: Cannot run program "vncserver" (in directory "/var/lib/jenkins/jobs/Python-test-poc/workspace"): java.io.IOException: error=2, No such file or directory
java.io.IOException: Cannot run program "vncserver" (in directory "/var/lib/jenkins/jobs/Python-test-poc/workspace"): java.io.IOException: error=2, No such file or directory
and some else.

one thing I should add is few minutes ago :
I do bottom steps on another debian machine and it build but in this machine it can't:
The steps are:

1.nano /etc/gdm3/daemon.conf
 in security section I add: DisallowTCP=false

2.nano /etc/X11/xinit/xserverrc
 change exec /usr/bin/X -nolisten tcp "$@" to exec /usr/bin/X "$@"

3.log off and run /etc/init.d/gdm3 restar

4.In terminal write: #xhost localhost

Thanks.


--

Dirk Heinrichs

unread,
Mar 31, 2014, 3:22:18 AM3/31/14
to jenkins...@googlegroups.com
Am 31.03.2014 08:02, schrieb Fatemeh Mehdizadeh:
FATAL: Cannot run program "vncserver"

Is it installed?

Bye...

Fatemeh Mehdizadeh

unread,
Mar 31, 2014, 3:37:20 AM3/31/14
to jenkins...@googlegroups.com
|   Is it installed?

Actually I didn't install vncserver on the machine that can run the test.

I'm new in jenkins and need your help.


--

Dirk Heinrichs

unread,
Mar 31, 2014, 7:32:05 AM3/31/14
to jenkins...@googlegroups.com
Am 31.03.2014 09:37, schrieb Fatemeh Mehdizadeh:

Actually I didn't install vncserver on the machine that can run the test.

I'm new in jenkins and need your help.

This is a Debian issue: apt-get install vnc4server

HTH...

Fatemeh Mehdizadeh

unread,
Apr 5, 2014, 2:33:47 AM4/5/14
to jenkins...@googlegroups.com
I install vnc4server and Xvnc plugin. Now when I build my test it can't fininsh the test. I mean about 10% remain in build status bar and freezes.

Again I should say in my previous successful build on another machine I didn't install vnc4server and Xvnc plugin.

I'm so confused and don't know what should I do.
Please help me.


--

Mark Waite

unread,
Apr 5, 2014, 5:18:24 AM4/5/14
to jenkins...@googlegroups.com

I think you probably want to discover why your build is hanging.  That might be simplest to do if you connect to the x server the job is using and look for any windows which may be open on the screen. From my Windows computer, I connect to the x server with ultraVNC.

If that doesn't work for you, then you could try increasing the amount of logging done by your build so that it will better show you exactly which step is hanging. If that doesn't help, you could check with the previous person who ran the build to understand the specific details of the build.

Mark Waite

Fatemeh Mehdizadeh

unread,
Apr 7, 2014, 1:31:57 AM4/7/14
to jenkins...@googlegroups.com
Hi,

Although i read your useful training but I can't still run my tests, so I go to /var/lib/jenkins/jobs/My-job in terminal to test if all things working well.

then I run "nosetests -v"
it has some errror that I think they don't allow build my job, the errors are:

(process:4928): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(process:4928): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(process:4928): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
QGtkStyle was unable to detect the current GTK+ theme.
Qt: Session management error: None of the authentication protocols specified are supported
ERROR

I also should say unfortunately I'm new in debian and jenkins. I try and searched a lot but with no success.

Thanks a lot for your useful help.

JonathanRRogers

unread,
Apr 7, 2014, 1:42:24 PM4/7/14
to jenkins...@googlegroups.com
On Monday, April 7, 2014 1:31:57 AM UTC-4, Fatemeh Mehdizadeh wrote:
Hi,

Although i read your useful training but I can't still run my tests, so I go to /var/lib/jenkins/jobs/My-job in terminal to test if all things working well.

then I run "nosetests -v"
it has some errror that I think they don't allow build my job, the errors are:

(process:4928): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(process:4928): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(process:4928): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
QGtkStyle was unable to detect the current GTK+ theme.
Qt: Session management error: None of the authentication protocols specified are supported
ERROR

I also should say unfortunately I'm new in debian and jenkins. I try and searched a lot but with no success.

I doubt your problem is much related to either Jenkins or Debian. It appears that nose is running a Qt program which tries to connect to dbus and fails to do so. However, I'm not sure if that's a fatal error. What is the Qt program and what do you expect it to do?
Reply all
Reply to author
Forward
0 new messages