[JIRA] (JENKINS-36355) Xvfb does not export DISPLAY variable

99 views
Skip to first unread message

burtsevyg@mail.ru (JIRA)

unread,
Jun 30, 2016, 9:23:02 AM6/30/16
to jenkinsc...@googlegroups.com
Yuriy Burtsev created an issue
 
Jenkins / Bug JENKINS-36355
Xvfb does not export DISPLAY variable
Issue Type: Bug Bug
Assignee: zregvart
Components: xvfb-plugin
Created: 2016/Jun/30 1:22 PM
Environment: Docker container with ubuntu 14.04
Priority: Major Major
Reporter: Yuriy Burtsev

My Jenkinsfile use Xvfb:

...
        parallel(
            intTests: {
                sh "mvn -B install -P intTests"
            }, funcTests: {
                wrap([$class: 'Xvfb']) {
                    sh "mvn -B install -PfuncTests"
                }
            }, failFast: false
        )
...

In test I try to run xfreerdp:

xf_pre_connect: failed to open display: :0
Please check that the $DISPLAY environment variable is properly set.
freerdp_pre_connect failed

If I manually export DISPLAY variable all work perfect.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

burtsevyg@mail.ru (JIRA)

unread,
Jun 30, 2016, 9:29:01 AM6/30/16
to jenkinsc...@googlegroups.com
Yuriy Burtsev updated an issue
Change By: Yuriy Burtsev
Environment:
Docker container with ubuntu 14.04

apt-get install -y xvfb xfonts-100dpi xfonts-75dpi xfonts-cyrillic xorg dbus-x11
apt-get install -y freerdp-x11

burtsevyg@mail.ru (JIRA)

unread,
Jun 30, 2016, 9:37:01 AM6/30/16
to jenkinsc...@googlegroups.com
Yuriy Burtsev updated an issue
My Jenkinsfile use Xvfb:


{code:java}

...
        parallel(
            intTests: {
                sh "mvn -B install -P intTests"
            }, funcTests: {
                wrap([$class: 'Xvfb']) {
                    sh "mvn -B install -PfuncTests"
                }
            }, failFast: false
        )
...
{code}


In test I try to run xfreerdp:

{code:java}

xf_pre_connect: failed to open display: :0
Please check that the $DISPLAY environment variable is properly set.
freerdp_pre_connect failed
{code}

If I manually export DISPLAY variable all work perfect.
May be there is a way to configure Xvfb in Jenkinsfile?

zregvart@java.net (JIRA)

unread,
Jul 1, 2016, 3:23:01 AM7/1/16
to jenkinsc...@googlegroups.com
zregvart commented on Bug JENKINS-36355
 
Re: Xvfb does not export DISPLAY variable

Yurie, thanks for reporting the issue. Can you run sh "env" in your wrap block? The DISPLAY environment variable should be set there. Also can you provide the versions of the Xvfb plugin, Jekins and console log of your pipeline job?

burtsevyg@mail.ru (JIRA)

unread,
Jul 1, 2016, 5:28:03 AM7/1/16
to jenkinsc...@googlegroups.com

You are right DISPLAY=:0 variable is present in env:

[Pipeline] wrap
Xvfb starting$ docker exec 98986538cd21937d631f1e122608275a939f6dba9c7c057b580067d02297620d env _JENKINS_XVFB_COOKIE=3dd4a4d5-eb45-44df-b3d5-7949a87e653c Xvfb :0 -screen 0 1024x768x24 -fbdir /home/jenkins/jenkins-node-1.651.3/xvfb-10-4491495452708784588.fbdir
+ env
JENKINS_HOME=/var/lib/jenkins
LANGUAGE=ru_RU:ru
HOSTNAME=98986538cd21
HUDSON_URL=***
HOME=/home/jenkins
BUILD_URL=***
JENKINS_SERVER_COOKIE=durable-51fd50bf64125932b5aed0f5bbfa2581
MAVEN_HOME=/usr/share/maven
NODE_NAME=oraci1
EXECUTOR_NUMBER=1
TERM=xterm
BUILD_DISPLAY_NAME=#10
HUDSON_HOME=/var/lib/jenkins
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
BUILD_ID=10
BUILD_TAG=***
DISPLAY=:0
JENKINS_URL=***
LANG=ru_RU.UTF-8
JOB_URL=***
BUILD_NUMBER=10
HUDSON_SERVER_COOKIE=cf7cadd9158162e5
CLASSPATH=
JOB_NAME=***
JAVA_HOME=/usr/lib/jvm/java-8-oracle
LC_ALL=ru_RU.UTF-8
PWD=/home/jenkins/jenkins-node-1.651.3/workspace/***/test-xvfb
[Pipeline] sh
[test-xvfb] Running shell script
+ xfreerdp -a 32 -g 1024x768 -k ru-ru -p *** -u ***--app --plugin rail --data calc.exe -- 10.196.2.98
loading plugin rail
xf_pre_connect: failed to open display: :0
Please check that the $DISPLAY environment variable is properly set.
freerdp_pre_connect failed
[Pipeline] }
Xvfb stopping
[Pipeline] // wrap
[Pipeline] }
$ docker stop 98986538cd21937d631f1e122608275a939f6dba9c7c057b580067d02297620d
$ docker rm -f 98986538cd21937d631f1e122608275a939f6dba9c7c057b580067d02297620d

Version Xvfb plugin 1.1.3
Version Jenkins 1.651.3
But if I run docker container manually add DISPLAY variable run Xvfb with command:

Xvfb :0 -screen 0 1024x768x24 -fbdir /tmp

all work perfect.

burtsevyg@mail.ru (JIRA)

unread,
Jul 1, 2016, 5:29:03 AM7/1/16
to jenkinsc...@googlegroups.com
        withEnv(['DISPLAY=:0']) {
            sh '/usr/bin/Xvfb :0 -screen 0 1024x768x24 -fbdir &'
            sh 'xfreerdp -a 32 -g 1024x768 -k ru-ru -p *** -u ***--app --plugin rail --data "calc.exe" -- 10.196.2.98'
        }

also failed.

burtsevyg@mail.ru (JIRA)

unread,
Jul 1, 2016, 5:31:01 AM7/1/16
to jenkinsc...@googlegroups.com
Yuriy Burtsev edited a comment on Bug JENKINS-36355

{code:java}

        withEnv(['DISPLAY=:0']) {
            sh '/usr/bin/Xvfb :0 -screen 0 1024x768x24 -fbdir &'
            sh 'xfreerdp -a 32 24 -g 1024x768 -k ru-ru -p *** -u ***--app --plugin rail --data "calc.exe" -- 10.196.2.98'
        }
{code}


also failed.

burtsevyg@mail.ru (JIRA)

unread,
Jul 1, 2016, 5:45:01 AM7/1/16
to jenkinsc...@googlegroups.com
Yuriy Burtsev edited a comment on Bug JENKINS-36355
{code:java}
        withEnv(['DISPLAY=:0']) {
            sh '/usr/bin/Xvfb :0 -screen 0 1024x768x24 -fbdir /tmp &'
            sh 'xfreerdp -a 24 -g 1024x768 -k ru-ru -p *** -u ***--app --plugin rail --data "calc.exe" -- 10.196.2.98'
        }
{code}


also failed.

burtsevyg@mail.ru (JIRA)

unread,
Jul 1, 2016, 5:46:01 AM7/1/16
to jenkinsc...@googlegroups.com
Yuriy Burtsev edited a comment on Bug JENKINS-36355
{code:java}
        withEnv(['DISPLAY=:0']) {
            sh '/usr/bin/Xvfb :0 -screen 0 1024x768x24 -fbdir /tmp &'
            sh 'xfreerdp -a 24 -g 1024x768 -k ru-ru -p *** -u ***--app --plugin rail --data "calc.exe" -- 10.196.2.98'
        }
{code}


also failed
work for me .

burtsevyg@mail.ru (JIRA)

unread,
Jul 1, 2016, 5:55:01 AM7/1/16
to jenkinsc...@googlegroups.com

If need more details I try to help.

zregvart@java.net (JIRA)

unread,
Jul 10, 2016, 2:13:01 PM7/10/16
to jenkinsc...@googlegroups.com
zregvart commented on Bug JENKINS-36355

I believe I've tracked down the cause of the problem, in fact it was two issues that were causing this behavior: race condition between the test if Xvfb was running when started by docker exec and use of frame buffer directory for Xvfb that was not mounted as a volume in the started docker container. Now the timeout value defaults to 1 second, that should be enough to alleviate the race condition and frame buffer directory is created within the workspace of the build that should be present in the docker container.

I've released a beta version of the Xvfb plugin to the experimental update center could you install the version 1.1.4-beta1 from there and test if this fixed your problem?

burtsevyg@mail.ru (JIRA)

unread,
Nov 22, 2018, 3:50:03 AM11/22/18
to jenkinsc...@googlegroups.com
Change By: Yuriy Burtsev
Status: Open Fixed but Unreleased
Resolution: Fixed
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

burtsevyg@mail.ru (JIRA)

unread,
Nov 22, 2018, 3:50:04 AM11/22/18
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages