Search code examples
javajenkinsjenkins-agent

Unable to launch new slave in jenkins


I'm trying to launch a new slave to my Jenkins master and I'm getting the following error:

Linux ip-172-31-40-67 4.9.58-18.55.amzn1.x86_64 #1 SMP Thu Nov 2 04:38:47 
UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Installing JDK jdk-8u144-oth-JPR
Downloading JDK from http://download.oracle.com/otn/java/jdk/8u144-
b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz
java.io.IOException: Could not find any known supported java version in [java, /usr/bin/java, /usr/java/default/bin/java, /usr/java/latest/bin/java, /usr/local/bin/java, /usr/local/java/bin/java, /home/ec2-user/jdk/bin/java, /usr/bin/java/bin/java], and we also failed to install JDK as a fallback
at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:918)
at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:809)
at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:793)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Unable to find the login form
at hudson.tools.JDKInstaller.locate(JDKInstaller.java:465)
at hudson.plugins.sshslaves.SSHLauncher.attemptToInstallJDK(SSHLauncher.java:1039)
at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:916)
... 6 more
[11/15/17 10:10:09] Launch failed - cleaning up connection

I think the main issue is the line: Caused by: java.io.IOException: Unable to find the login form. However I cant seem to find anything online about this issue.. I have both JDK and JRE installed on the slave however when I launch the slave it stills trying to download JDK, I have no idea why..


Solution

  • This is related to New Oracle website prevents the JDKInstaller to download binaries from archives. Oracle changed their website a while ago.

    You have to download Java and install it separately on your slave. (For example: sudo apt-get install default-jre)

    This will do the trick :-D.