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

Checking java version fails - SSH slave not connecting

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Blocker
    • Resolution: Incomplete
    • ssh-slaves-plugin
    • None
    • Linux (RHEL master + Ubuntu slave)

    Description

      I've seen the issue as resolved (at least twice), but it still occurs for me.
      Despite having Java binary on slave and master, the SSH Slave plugin fails to find Java version.
      Error log:
      ====================
      [07/16/13 10:48:00] [SSH] Opening SSH connection to [...]:22.
      [07/16/13 10:48:00] [SSH] Authentication successful.

      [07/16/13 10:48:00] [SSH] The remote users environment is:
      [07/16/13 10:48:00] [SSH] Checking java version of java
      Couldn't figure out the Java version of java

      [07/16/13 10:48:00] [SSH] Checking java version of /usr/bin/java
      Couldn't figure out the Java version of /usr/bin/java

      [07/16/13 10:48:00] [SSH] Checking java version of /usr/java/default/bin/java
      Couldn't figure out the Java version of /usr/java/default/bin/java

      [07/16/13 10:48:00] [SSH] Checking java version of /usr/java/latest/bin/java
      Couldn't figure out the Java version of /usr/java/latest/bin/java

      [07/16/13 10:48:00] [SSH] Checking java version of /usr/local/bin/java
      Couldn't figure out the Java version of /usr/local/bin/java

      [07/16/13 10:48:00] [SSH] Checking java version of /usr/local/java/bin/java
      Couldn't figure out the Java version of /usr/local/java/bin/java

      [07/16/13 10:48:00] [SSH] Checking java version of /bin/java
      Couldn't figure out the Java version of /bin/java

      hudson.util.IOException2: 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, /bin/java], and we also failed to install JDK as a fallback
      at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:557)
      at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:493)
      at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:230)
      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:662)
      Caused by: java.io.IOException: Failed to detect the environment for automatic JDK installation. Please report this to jenkinsci-users@googlegroups.com:
      at hudson.plugins.sshslaves.SSHLauncher.attemptToInstallJDK(SSHLauncher.java:654)
      at hudson.plugins.sshslaves.SSHLauncher.resolveJava(SSHLauncher.java:555)
      ... 7 more
      [07/16/13 10:48:00] [SSH] Connection closed.

      Attachments

        Activity

          where is your java on the slave? and did you try setting the explicit path in the "advanced" box?

          stephenconnolly Stephen Connolly added a comment - where is your java on the slave? and did you try setting the explicit path in the "advanced" box?
          weakcamel Waldek M added a comment -

          Hello,
          I've got several java locations on the slave, one of them is

          $ /usr/local/java/latest/bin/java -version
          java version "1.6.0_26"
          Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
          Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

          Setting the env variables JAVA_HOME and JAVA_PATH doesn't change this behavior.
          Using the JavaPath setting in Advanced results in

          [10/09/13 11:36:56] [SSH] Opening SSH connection to <slave_machine>:22.
          [10/09/13 11:36:56] [SSH] Authentication successful.
          [10/09/13 11:36:56] [SSH] The remote users environment is:
          [10/09/13 11:36:56] [SSH] Starting sftp client.

          then some waiting and it restarts the connection attempt, indefinitely.

          weakcamel Waldek M added a comment - Hello, I've got several java locations on the slave, one of them is $ /usr/local/java/latest/bin/java -version java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) Setting the env variables JAVA_HOME and JAVA_PATH doesn't change this behavior. Using the JavaPath setting in Advanced results in [10/09/13 11:36:56] [SSH] Opening SSH connection to <slave_machine>:22. [10/09/13 11:36:56] [SSH] Authentication successful. [10/09/13 11:36:56] [SSH] The remote users environment is: [10/09/13 11:36:56] [SSH] Starting sftp client. then some waiting and it restarts the connection attempt, indefinitely.

          OK so setting the JavaPath fixed your issue and it was able to progress further and you have hit a different issue

          stephenconnolly Stephen Connolly added a comment - OK so setting the JavaPath fixed your issue and it was able to progress further and you have hit a different issue
          weakcamel Waldek M added a comment -

          Yes, apparently it hits something else, but setting explicit JavaPath is rather a workaround for the detection issue, isn't it?
          In the normal case, the java binary is definitely on PATH, it's current and yet it's still not recognized.

          weakcamel Waldek M added a comment - Yes, apparently it hits something else, but setting explicit JavaPath is rather a workaround for the detection issue, isn't it? In the normal case, the java binary is definitely on PATH, it's current and yet it's still not recognized.

          Fixed this by creating a symbolic for /usr/local/bin/java to my java path

          Eg: ln -s /build/toolchain/lin64/jdk1.8.0.121/java /usr/local/bin/java

          faezshingeri Mohammed Faez Shingeri added a comment - Fixed this by creating a symbolic for /usr/local/bin/java to my java path Eg: ln -s /build/toolchain/lin64/jdk1.8.0.121/java /usr/local/bin/java

          People

            kohsuke Kohsuke Kawaguchi
            weakcamel Waldek M
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: