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

[xvnc] Client is not authorized to connect to Server

    Details

    • Similar Issues:

      Description

      I've upgraded today to Jenkins 1.554 and Xvnc plugin 1.16 and the jobs started to fail.

      • Xvnc command line (from Jenkins config):
        vncserver :$DISPLAY_NUMBER -nolisten tcp -geometry 1280x800 -depth 24 -fp catalogue:/etc/X11/fontpath.d
        
      • Xvnc related info in the job log:
        [xwiki-enterprise-test-extension] $ vncserver :71 -nolisten tcp -geometry 1280x800 -depth 24 -fp catalogue:/etc/X11/fontpath.d
        
        New 'X' desktop is vagent-1-2-dev:71
        
        Starting applications specified in /home/hudsonagent/.vnc/xstartup
        Log file is /home/hudsonagent/.vnc/vagent-1-2-dev:71.log
        
        ...
        
        java.lang.InternalError: Can't connect to X11 window server using ':71' as the value of the DISPLAY variable.
        
      • vnc log:
        10/03/14 16:22:14 Xvnc version TightVNC-1.3.9
        10/03/14 16:22:14 Copyright (C) 2000-2007 TightVNC Group
        10/03/14 16:22:14 Copyright (C) 1999 AT&T Laboratories Cambridge
        10/03/14 16:22:14 All Rights Reserved.
        10/03/14 16:22:14 See http://www.tightvnc.com/ for information on TightVNC
        10/03/14 16:22:14 Desktop name 'X' (vagent-1-2-dev:71)
        10/03/14 16:22:14 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
        10/03/14 16:22:14 Listening for VNC connections on TCP port 5971
        Font directory '/usr/share/fonts/X11/Speedo/' not found - ignoring
        Font directory '/usr/share/fonts/X11/Type1/' not found - ignoring
        Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
        Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        Client is not authorized to connect to Serverxrdb: Resource temporarily unavailable
        xrdb: Can't open display ':71'
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        Client is not authorized to connect to Serverxsetroot:  unable to open display ':71'
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:22:15 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:23:26 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:23:26 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:23:26 2014: 27217 Xtightvnc: client 1 rejected from local host
        AUDIT: Mon Mar 10 16:23:26 2014: 27217 Xtightvnc: client 1 rejected from local host
        
      • vnc command line (ps -aux | grep vnc):
        Xtightvnc :71 -desktop X -auth /home/hudsonagent/hudson_root/workspace/xwiki-enterprise-test-extension/.Xauthority-328169632546426497 -geometry 1280x800 -depth 24 -rfbwait 120000 -rfbauth /home/hudsonagent/.vnc/passwd -rfbport 5971 -co /etc/X11/rgb -nolisten tcp
        
      • When trying to start the browser from the command line:
        Client is not authorized to connect to ServerClient is not authorized to connect to ServerError: cannot open display: :71
        

      Downgrading back to 1.14 version of Xvnc fixed the problem.

      Note that I can start the browser (and everything works fine) if I run this:

      Xtightvnc :71 -desktop X -auth /home/hudsonagent/.Xauthority -geometry 1280x800 -depth 24 -rfbwait 120000 -rfbauth /home/hudsonagent/.vnc/passwd -rfbport 5971 -co /etc/X11/rgb -nolisten tcp
      

      from the command line instead. Thus it seems the problem is with the

      /home/hudsonagent/hudson_root/workspace/xwiki-enterprise-test-extension/.Xauthority-328169632546426497
      

      file or path (although .Xauthority-328169632546426497 seems to be just a copy of .Xauthority, same size).

        Attachments

          Activity

          Hide
          sodul Stephane Odul added a comment -

          I have the same issue. I rolled back to version 1.14 of the plugin and my jobs are working again.

          Show
          sodul Stephane Odul added a comment - I have the same issue. I rolled back to version 1.14 of the plugin and my jobs are working again.
          Hide
          levsa Levon Saldamli added a comment -

          @Stephane, are you also running TightVNC?

          Show
          levsa Levon Saldamli added a comment - @Stephane, are you also running TightVNC?
          Hide
          sodul Stephane Odul added a comment -

          Yes: TightVNC Server version 1.3.9
          The OS is Ubuntu 12.04 LTS AMD64

          Show
          sodul Stephane Odul added a comment - Yes: TightVNC Server version 1.3.9 The OS is Ubuntu 12.04 LTS AMD64
          Hide
          slipcon Scott Lipcon added a comment -

          We see similar after upgrading to xvnc plugin 1.16 today - jenkins version stayed the same @ 1.549. Reverting back to 1.14 seems to have fixed it for us as well.

          In our job log we see:

              [junit] Xlib: connection to ":91.0" refused by server
              [junit] Xlib: No protocol specified
              [junit] 
              [junit] Xlib: connection to ":91.0" refused by server
              [junit] Xlib: No protocol specified
          

          from our ant/junit tests which need an X server. Happy to provide any additional information if it might help

          Show
          slipcon Scott Lipcon added a comment - We see similar after upgrading to xvnc plugin 1.16 today - jenkins version stayed the same @ 1.549. Reverting back to 1.14 seems to have fixed it for us as well. In our job log we see: [junit] Xlib: connection to ":91.0" refused by server [junit] Xlib: No protocol specified [junit] [junit] Xlib: connection to ":91.0" refused by server [junit] Xlib: No protocol specified from our ant/junit tests which need an X server. Happy to provide any additional information if it might help
          Hide
          nneul Nathan Neulinger added a comment -

          I see same issue on a Fedora 17 build host with the 'no protocol' errors.

          The underlying problem is that XAUTHORITY environment variable is not set in any of the child processes of the job - as a result, nothing knows to USE the per-job xauthority file.

          Show
          nneul Nathan Neulinger added a comment - I see same issue on a Fedora 17 build host with the 'no protocol' errors. The underlying problem is that XAUTHORITY environment variable is not set in any of the child processes of the job - as a result, nothing knows to USE the per-job xauthority file.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Levon Saldamli
          Path:
          src/main/java/hudson/plugins/xvnc/Xvnc.java
          http://jenkins-ci.org/commit/xvnc-plugin/fde90296310a10f02e2539ff155dc5311937d02d
          Log:
          Fixed bug JENKINS-22105. Quotes around the xauthority filename broke xauth completely. This will reintroduce the spaces in job names bug, but that should be fixed in vncserver.

          Compare: https://github.com/jenkinsci/xvnc-plugin/compare/44a5162782f9...fde90296310a

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Levon Saldamli Path: src/main/java/hudson/plugins/xvnc/Xvnc.java http://jenkins-ci.org/commit/xvnc-plugin/fde90296310a10f02e2539ff155dc5311937d02d Log: Fixed bug JENKINS-22105 . Quotes around the xauthority filename broke xauth completely. This will reintroduce the spaces in job names bug, but that should be fixed in vncserver. Compare: https://github.com/jenkinsci/xvnc-plugin/compare/44a5162782f9...fde90296310a
          Hide
          levsa Levon Saldamli added a comment -

          Fixed in 1.17.

          Show
          levsa Levon Saldamli added a comment - Fixed in 1.17.

            People

            • Assignee:
              levsa Levon Saldamli
              Reporter:
              mflorea Marius Dumitru Florea
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: