Issue Details (XML | Word | Printable)

Key: HUDSON-6880
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: mindless
Reporter: jeroen_muis
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Hudson

Automatically installing JDK in mixed environment fails

Created: 29/Jun/10 06:28 AM   Updated: 28/Jul/10 08:01 AM   Resolved: 28/Jul/10 08:01 AM
Component/s: master-slave
Affects Version/s: current
Fix Version/s: None

File Attachments: 1. Text File jdkinstaller.patch (0.8 kB)

Environment:
Master=Windows 2003 x86
Slave=Ubuntu Linux x64 (ssh connected)


 Description  « Hide

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



Sort Order: Ascending order - Click to sort in descending order
jeroen_muis added a comment - 17/Jul/10 03:05 AM

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.


jeroen_muis added a comment - 17/Jul/10 03:10 AM

Please review patch and apply.
Thanks,
Jeroen


mindless added a comment - 21/Jul/10 03:44 PM

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


mindless added a comment - 28/Jul/10 08:01 AM

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 HUDSON-6880] patch from jeroen_muis to fix autoinstall of JDK with
windows master and linux slave. I applied same change for reverse situation.