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

          Ric Klaren created issue -

          Fixed in 1.16

          Levon Saldamli added a comment - Fixed in 1.16
          Levon Saldamli made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          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.
          Levon Saldamli made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          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).
          Levon Saldamli made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]

          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 made changes -
          Resolution Original: Not A Defect [ 7 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          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?

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

              Created:
              Updated: