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

Perforce Plugin running on a Windows 2008R2 slave fails to poll or check out.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • p4-plugin
    • None
    • Windows 2008R2 Slave.

      We've been trying to configure a Windows 2008R2 slave (our first slave with this OS) to run a job that is already known to run successfully on other Windows XP and 2003 machines. We know that the plugin runs fine on a Windows 2008 master.

      We have confirmed that Perforce has been installed successfully by running all the equivalent commands from the command line and have checked and double checked the configuration and executable locations.

      We suspect that the problem is associated with the fact that with Windows 2008 the command line syntax has become far more strict and that the Perforce plugin uses different code paths to build the command line and execute the perforce process. On the master the plugin uses the Launcher classes to run the Perforce binary but on the slave it appears to use CmdLineExecutor class.

      The following exception is seen in the logs:
      [TEST_util] $ C:\PROGRA~1\Perforce\p4.exe workspace -o hudson_1_glp_4.0_utility_test-3510769
      Caught exception communicating with perforce. Connect to server failed; check $P4PORTcom.tek42.perforce.PerforceException: Connect to server failed; check $P4PORT
      at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:381)
      at com.tek42.perforce.parse.AbstractPerforceTemplate.getPerforceResponse(AbstractPerforceTemplate.java:291)
      at com.tek42.perforce.parse.Workspaces.getWorkspace(Workspaces.java:53)
      at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1183)
      at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:574)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1180)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:506)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:422)
      at hudson.model.Run.run(Run.java:1362)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:145)

          [JENKINS-9697] Perforce Plugin running on a Windows 2008R2 slave fails to poll or check out.

          Robert Boothby created issue -

          Rob Petti added a comment -

          Which version of Jenkins and which version of the Perforce Plugin are you using?

          Why do you say it's using the CmdLineExecutor class? On the master, it uses the Launcher class, which in turn uses the LocalLauncher class. On the slave it's using a custom class which in turn uses a LocalLauncher to perform the actual execution. They both end up using the exact same code to perform the execution.

          If your master is 2008 as you say, then this could just be a problem with 2008R2 and have nothing to do with the fact that it's running as a slave.

          All that being said, I'm unable to reproduce this problem. There aren't any issues when running the perforce plugin on a WS2008R2 slave machine. Make sure your perforce connection information is correct in the plugin configuration. The error you are getting suggests a problem with the configuration, and not anything to do with the way windows handles command line arguments. It's possible that the problem only exists in a particular version of Jenkins and/or the plugin, so I'll need to know what versions you are running in order to be sure.

          Rob Petti added a comment - Which version of Jenkins and which version of the Perforce Plugin are you using? Why do you say it's using the CmdLineExecutor class? On the master, it uses the Launcher class, which in turn uses the LocalLauncher class. On the slave it's using a custom class which in turn uses a LocalLauncher to perform the actual execution. They both end up using the exact same code to perform the execution. If your master is 2008 as you say, then this could just be a problem with 2008R2 and have nothing to do with the fact that it's running as a slave. All that being said, I'm unable to reproduce this problem. There aren't any issues when running the perforce plugin on a WS2008R2 slave machine. Make sure your perforce connection information is correct in the plugin configuration. The error you are getting suggests a problem with the configuration, and not anything to do with the way windows handles command line arguments. It's possible that the problem only exists in a particular version of Jenkins and/or the plugin, so I'll need to know what versions you are running in order to be sure.

          Rob Petti added a comment -

          Cannot reproduce, and insufficient information provided.

          Rob Petti added a comment - Cannot reproduce, and insufficient information provided.
          Rob Petti made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Glenn Mayer added a comment -

          I'm actually having the exact same issue; perhaps I can provide more info. I'm running Jenkins 1.411 on an AIX (5.3) box, and the slave is on Windows 2008(R2). The perforce plugin is 1.2.5. On the slave, I have run p4 commands that contain the same configuration as I entered into Jenkins, and they work fine. I have tried using both the perforce server name and the IP in the P4PORT field in Jenkins. I still get the "Connect to server failed; check $P4PORTcom.tek42.perforce.PerforceException" error. This same configuration worked when the slave was a WinXP PC.

          Glenn Mayer added a comment - I'm actually having the exact same issue; perhaps I can provide more info. I'm running Jenkins 1.411 on an AIX (5.3) box, and the slave is on Windows 2008(R2). The perforce plugin is 1.2.5. On the slave, I have run p4 commands that contain the same configuration as I entered into Jenkins, and they work fine. I have tried using both the perforce server name and the IP in the P4PORT field in Jenkins. I still get the "Connect to server failed; check $P4PORTcom.tek42.perforce.PerforceException" error. This same configuration worked when the slave was a WinXP PC.
          Glenn Mayer made changes -
          Assignee New: Rob Petti [ rpetti ]
          Resolution Original: Cannot Reproduce [ 5 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Rob Petti added a comment -

          Can you also provide me with:
          The version of your perforce client on the slave.
          The version of your perforce server.
          The version of Java installed on the slave.
          The version of Java installed on the master.

          Rob Petti added a comment - Can you also provide me with: The version of your perforce client on the slave. The version of your perforce server. The version of Java installed on the slave. The version of Java installed on the master.

          Glenn Mayer added a comment -

          The version of your perforce client on the slave: Perforce Visual Client/NTX86/2010.2/317255
          The version of your perforce server: P4D/LINUX26X86_64/2009.2/256645 (2010/07/26)
          The version of Java installed on the slave: 1.6
          The version of Java installed on the master: 1.5

          Glenn Mayer added a comment - The version of your perforce client on the slave: Perforce Visual Client/NTX86/2010.2/317255 The version of your perforce server: P4D/LINUX26X86_64/2009.2/256645 (2010/07/26) The version of Java installed on the slave: 1.6 The version of Java installed on the master: 1.5

          Rob Petti added a comment -

          Perforce Visual Client/NTX86/2010.2/317255 Is not a command line client... If this is what you are pointing your perforce configuration to, then that's why it's not working. If this is the case, you need to download and install the command line client (p4.exe) and use that instead. Also be sure to download 2009.2 so it matches your server version.

          Rob Petti added a comment - Perforce Visual Client/NTX86/2010.2/317255 Is not a command line client... If this is what you are pointing your perforce configuration to, then that's why it's not working. If this is the case, you need to download and install the command line client (p4.exe) and use that instead. Also be sure to download 2009.2 so it matches your server version.

          Rob Petti added a comment -

          I retested using Jenkins 1.411 on a modern linux master and my results were the same as before; everything is working fine.

          I'm attempting to run Jenkins 1.411 on an AIX machine now, and I'm not having much luck getting the slave connected at all. I'm using IBM's JVM v1.5, and I'm getting plenty of errors when trying to connect the slave. Which specific version of Java are you running on your master? "1.5" isn't enough information, I need the full output of 'java -version'.

          Rob Petti added a comment - I retested using Jenkins 1.411 on a modern linux master and my results were the same as before; everything is working fine. I'm attempting to run Jenkins 1.411 on an AIX machine now, and I'm not having much luck getting the slave connected at all. I'm using IBM's JVM v1.5, and I'm getting plenty of errors when trying to connect the slave. Which specific version of Java are you running on your master? "1.5" isn't enough information, I need the full output of 'java -version'.

            Unassigned Unassigned
            robertboothby Robert Boothby
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: