Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19139

Xvnc plugin fails if the job has a space in the name

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • xvnc-plugin
    • None

      We have quite a lot of jobs with spaces in the name since upgrading to the 1.14 version from the 1.11 version we encounter the following error:

      Fetching upstream changes from origin
      Commencing build of Revision ae0dcf48e628395417055fe2fc2a6434bf02565d (origin/master)
      Checking out Revision ae0dcf48e628395417055fe2fc2a6434bf02565d (origin/master)
      Starting xvnc
      [Deployit Core] $ vncserver :65 -localhost -nolisten tcp
      xauth:  file /var/lib/jenkins/workspace/Deployit does not exist
      xauth: (argv):1:  unknown command "Core/.Xauthority-2561200615964975228"
      xauth:  file /var/lib/jenkins/workspace/Deployit does not exist
      xauth: (argv):1:  unknown command "Core/.Xauthority-2561200615964975228"
      Couldn't start Xtightvnc; trying default font path.
      Please set correct fontPath in the vncserver script.
      Couldn't start Xtightvnc process.
      
      
      Unrecognized option: Core/.Xauthority-2561200615964975228
      use: X [:<display>] [option]
      -a #                   mouse acceleration (pixels)
      -ac                    disable access control restrictions
      -audit int             set audit trail level
      -auth file             select authorization file
      bc                     enable bug compatibility
      -bs                    disable any backing store support
      -c                     turns off key-click
      c #                    key-click volume (0-100)
      -cc int                default color visual class
      ....
      -version               report Xvnc version on stderr
      FATAL: Failed to run 'vncserver :37 -localhost -nolisten tcp' (exit code 255), blacklisting display #37; consider checking the "Clean up before start" option
      java.io.IOException: Failed to run 'vncserver :37 -localhost -nolisten tcp' (exit code 255), blacklisting display #37; consider checking the "Clean up before start" option
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:107)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.doSetUp(Xvnc.java:104)
      	at hudson.plugins.xvnc.Xvnc.setUp(Xvnc.java:74)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:154)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:584)
      	at hudson.model.Run.execute(Run.java:1575)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:237)
      

          [JENKINS-19139] Xvnc plugin fails if the job has a space in the name

          Fixed in 1.16

          Levon Saldamli added a comment - Fixed in 1.16

          Adding "" in the path value in XAUTHORITY value didn't work (causes wrong file name issues).

          The problem is in the "vncserver" script which contains the line:

          open (XAUTH, "|xauth -f $xauthorityFile source -");

          which needs "" around $xauthorityFile .

          I'll be reverting my fix in 1.17.

          Levon Saldamli added a comment - Adding "" in the path value in XAUTHORITY value didn't work (causes wrong file name issues). The problem is in the "vncserver" script which contains the line: open (XAUTH, "|xauth -f $xauthorityFile source -"); which needs "" around $xauthorityFile . I'll be reverting my fix in 1.17.

          The problem is in the vncserver start script, which doesn't put quotes around the xauthority filename. Fix/report that bug in vncserver or don't use spaces in job names (or disable per build xauthority checkbox).

          Levon Saldamli added a comment - The problem is in the vncserver start script, which doesn't put quotes around the xauthority filename. Fix/report that bug in vncserver or don't use spaces in job names (or disable per build xauthority checkbox).

          James Nord added a comment - - edited

          Should be worked around in the plugin as you can start vncserver fine if you quote the string and escape the spaces on Linux.
          It will require a long long time for any fix to make it into all distributions.

          root@linux-slave:~# export XAUTHORITY="/home/jenkins/with\ space/.xauth"
          root@linux-slave:~# vncserver
          
          New 'linux-slave:2 (root)' desktop is linux-slave:2
          
          Starting applications specified in /home/jenkins/.vnc/xstartup
          Log file is /home/jenkins/.vnc/linux-slave:2.log
          

          James Nord added a comment - - edited Should be worked around in the plugin as you can start vncserver fine if you quote the string and escape the spaces on Linux. It will require a long long time for any fix to make it into all distributions. root@linux-slave:~# export XAUTHORITY="/home/jenkins/with\ space/.xauth" root@linux-slave:~# vncserver New 'linux-slave:2 (root)' desktop is linux-slave:2 Starting applications specified in /home/jenkins/.vnc/xstartup Log file is /home/jenkins/.vnc/linux-slave:2.log

          James Nord added a comment -

          which breaks other tools - could we not use a temporary file (appropriately secured) in /tmp as a workaround if the user wants to make progress?

          James Nord added a comment - which breaks other tools - could we not use a temporary file (appropriately secured) in /tmp as a workaround if the user wants to make progress?

          Code changed in jenkins
          User: Robert Sandell
          Path:
          src/main/java/hudson/plugins/xvnc/Xvnc.java
          src/main/resources/hudson/plugins/xvnc/Xvnc/global.jelly
          src/main/resources/hudson/plugins/xvnc/Xvnc/help-xauthorityInFsRoot.html
          src/test/java/hudson/plugins/xvnc/XvncTest.java
          http://jenkins-ci.org/commit/xvnc-plugin/1ce66992dbc518d460943b31a640055d4ff9543a
          Log:
          Configuration for placing the xauthority file in node fs root

          Added a configuration option to place the temporary xauthority file
          on the fs root of the node instead of the in the build's workspace.
          This can be used as a workaround for JENKINS-19139 if the path to
          the fs root doesn't contain any spaces but for example the folder
          to the job does.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: src/main/java/hudson/plugins/xvnc/Xvnc.java src/main/resources/hudson/plugins/xvnc/Xvnc/global.jelly src/main/resources/hudson/plugins/xvnc/Xvnc/help-xauthorityInFsRoot.html src/test/java/hudson/plugins/xvnc/XvncTest.java http://jenkins-ci.org/commit/xvnc-plugin/1ce66992dbc518d460943b31a640055d4ff9543a Log: Configuration for placing the xauthority file in node fs root Added a configuration option to place the temporary xauthority file on the fs root of the node instead of the in the build's workspace. This can be used as a workaround for JENKINS-19139 if the path to the fs root doesn't contain any spaces but for example the folder to the job does.

          Jesse Glick added a comment -

          Fix/report that bug in vncserver

          …and did anyone ever actually do that? If so, is there a link? Status of fix in various distributions?

          Should this be assigned to rsandell who is apparently working on a fix in https://github.com/jenkinsci/xvnc-plugin/pull/8 ?

          Jesse Glick added a comment - Fix/report that bug in vncserver …and did anyone ever actually do that? If so, is there a link? Status of fix in various distributions? Should this be assigned to rsandell who is apparently working on a fix in https://github.com/jenkinsci/xvnc-plugin/pull/8 ?

          Code changed in jenkins
          User: Robert Sandell
          Path:
          src/main/java/hudson/plugins/xvnc/Xvnc.java
          src/test/java/hudson/plugins/xvnc/XvncTest.java
          http://jenkins-ci.org/commit/xvnc-plugin/a599340782a46eedc7fa87ee9ced8aeec472a1cb
          Log:
          Alternate placing of the xauthority file

          A workaround for JENKINS-19139.
          If the workspace path contains spaces it will try to put the file
          in the slave fs root, and if that path also contains spaces it will
          try to put it in java.io.tmpdir.

          Compare: https://github.com/jenkinsci/xvnc-plugin/compare/1ce66992dbc5...a599340782a4

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Robert Sandell Path: src/main/java/hudson/plugins/xvnc/Xvnc.java src/test/java/hudson/plugins/xvnc/XvncTest.java http://jenkins-ci.org/commit/xvnc-plugin/a599340782a46eedc7fa87ee9ced8aeec472a1cb Log: Alternate placing of the xauthority file A workaround for JENKINS-19139 . If the workspace path contains spaces it will try to put the file in the slave fs root, and if that path also contains spaces it will try to put it in java.io.tmpdir. Compare: https://github.com/jenkinsci/xvnc-plugin/compare/1ce66992dbc5...a599340782a4

          rsandell added a comment -

          Maybe my search foo is a bit off but I haven't manage to find the project page or the issue tracker for that package when I researched the issue.

          rsandell added a comment - Maybe my search foo is a bit off but I haven't manage to find the project page or the issue tracker for that package when I researched the issue.

          > …and did anyone ever actually do that? If so, is there a link? Status of fix in various distributions?

          Not lazy people do this always. Also i don't see what linux distro was used because vncserver has different implementations.

          for hacks on jenkins side instead upstream fixes.

          Kanstantsin Shautsou added a comment - > …and did anyone ever actually do that? If so, is there a link? Status of fix in various distributions? Not lazy people do this always. Also i don't see what linux distro was used because vncserver has different implementations. for hacks on jenkins side instead upstream fixes.

            levsa Levon Saldamli
            rklaren Ric Klaren
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: