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

Automatically installing JDK in mixed environment fails

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: remoting
    • Labels:
      None
    • Environment:
      Master=Windows 2003 x86
      Slave=Ubuntu Linux x64 (ssh connected)

      Description

      When starting a maven 2 build the slave fails installing the JDK. I've tried several versions from update 17-20 and they all fail with equal errors.

      Reason seems incorrect path building by the master as the working dir is set in Windows style instead of *nix style. (backslashes against forward slashes). Please see build log below. The jdk.sh install file is downloaded to the slave & when manually run, gives no error at all. Of course, on the next build the JDK get's reinstalled & fails once more.

      Started by user anonymous
      Building remotely on work7203 (ssh)
      Updating svn://10.72.20.100/StepII/trunk
      At revision 22552
      no change for svn://10.72.20.100/StepII/trunk since the previous build
      Downloading file:/C:/Documents and Settings/Default User/.hudson/cache/jdks/LINUX/amd64/jdk-6u20-oth-JPR@CDS-CDS_Developer
      Installing /home/hudson/tools/JDK1.6.0_20/jdk.sh
      [JDK1.6.0_20] $ /home/hudson/tools/JDK1.6.0_20/jdk.sh -noregister
      ERROR: Failed to parse POMs
      java.io.IOException: Cannot run program "/home/hudson/tools/JDK1.6.0_20/jdk.sh" (in directory "\home\hudson\tools\JDK1.6.0_20"): java.io.IOException: error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
      at hudson.Proc$LocalProc.<init>(Proc.java:192)
      at hudson.Proc$LocalProc.<init>(Proc.java:164)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:638)
      at hudson.Launcher$ProcStarter.start(Launcher.java:273)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:793)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:767)
      at hudson.remoting.UserRequest.perform(UserRequest.java:114)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:270)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
      at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
      at java.lang.ProcessImpl.start(ProcessImpl.java:65)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
      ... 15 more
      Sending e-mails to: *************
      Finished: FAILURE

        Activity

        Hide
        jeroen_muis jeroen_muis added a comment -

        Problem is due to Windows Filepath settings.
        Instead of calling the remote working directory path the path is set by a call to the master java.io.File instance. On Windows this resolves to '\' instead of '/' crashing the install on Linux slaves.

        Fixed by querying a FilePath instance on the slave. Attached patch file.

        Show
        jeroen_muis jeroen_muis added a comment - Problem is due to Windows Filepath settings. Instead of calling the remote working directory path the path is set by a call to the master java.io.File instance. On Windows this resolves to '\' instead of '/' crashing the install on Linux slaves. Fixed by querying a FilePath instance on the slave. Attached patch file.
        Hide
        jeroen_muis jeroen_muis added a comment -

        Please review patch and apply.
        Thanks,
        Jeroen

        Show
        jeroen_muis jeroen_muis added a comment - Please review patch and apply. Thanks, Jeroen
        Hide
        mindless Alan Harder added a comment -

        Thanks.. presumably a linux master with windows slave would have a similar problem, so I'll use FilePath in the WINDOWS case too.

        Show
        mindless Alan Harder added a comment - Thanks.. presumably a linux master with windows slave would have a similar problem, so I'll use FilePath in the WINDOWS case too.
        Hide
        mindless Alan Harder added a comment -

        r33136 | mindless | 2010-07-21 16:41:15 -0600 (Wed, 21 Jul 2010)
        Changed paths:
        M /trunk/hudson/main/core/src/main/java/hudson/tools/JDKInstaller.java
        M /trunk/www/changelog.html

        [FIXED JENKINS-6880] patch from jeroen_muis to fix autoinstall of JDK with
        windows master and linux slave. I applied same change for reverse situation.

        Show
        mindless Alan Harder added a comment - r33136 | mindless | 2010-07-21 16:41:15 -0600 (Wed, 21 Jul 2010) Changed paths: M /trunk/hudson/main/core/src/main/java/hudson/tools/JDKInstaller.java M /trunk/www/changelog.html [FIXED JENKINS-6880] patch from jeroen_muis to fix autoinstall of JDK with windows master and linux slave. I applied same change for reverse situation.

          People

          • Assignee:
            mindless Alan Harder
            Reporter:
            jeroen_muis jeroen_muis
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: