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

GlobalTool JDK installation (via extract installer) fails for JDK12 onwards

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None

      When using the Global Tool Configuration to install a JDK, there are several types of installers.

      If the "Extract .zip/.tar.gz" is selected, it will fail from JDK 12 onwards.

      The error in the log is bellow:

      Started by user unknown or anonymous
      Running in Durability level: MAX_SURVIVABILITY[Pipeline] Start of Pipeline[Pipeline] nodeRunning on [Jenkins|https://<URL>/computer/(master)/] in /tmp/jenkins/<WORKSPACE>[Pipeline] {[Pipeline] stage[Pipeline] { (Declarative: Tool Install)[Pipeline] toolUnpacking [https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_osx-x64_bin.tar.gz] to /opt/jenkins/tools/hudson.model.JDK/openjdk12_fails on Jenkins[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of Pipelinejava.nio.file.NoSuchFileException: /opt/jenkins/tools/hudson.model.JDK/openjdk12_fails/./jdk-12.0.2.jdk/Contents/Home/lib/server/classes.jsa
      	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
      	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
      	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
      	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
      	at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434)
      	at java.nio.file.Files.newOutputStream(Files.java:216)
      	at hudson.util.IOUtils.copy(IOUtils.java:42)
      	at hudson.FilePath.readFromTar(FilePath.java:2579)
      Caused: java.io.IOException: Failed to extract input stream
      	at hudson.FilePath.readFromTar(FilePath.java:2589)
      	at hudson.FilePath.access$500(FilePath.java:212)
      	at hudson.FilePath$UntarFrom.invoke(FilePath.java:812)
      	at hudson.FilePath$UntarFrom.invoke(FilePath.java:803)
      	at hudson.FilePath.act(FilePath.java:1076)
      	at hudson.FilePath.act(FilePath.java:1059)
      	at hudson.FilePath.untarFrom(FilePath.java:798)
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:930)
      Caused: java.io.IOException: Failed to unpack 
      [https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_osx-x64_bin.tar.gz]
       (183950127 bytes read of total 190273787)
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:932)
      Caused: java.io.IOException: Failed to install 
      [https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_osx-x64_bin.tar.gz]
       to /opt/jenkins/tools/hudson.model.JDK/openjdk12_fails
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:938)
      	at hudson.FilePath.installIfNecessaryFrom(FilePath.java:846)
      	at hudson.tools.ZipExtractionInstaller.performInstallation(ZipExtractionInstaller.java:83)
      	at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:69)
      	at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
      	at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206)
      	at hudson.model.JDK.forNode(JDK.java:147)
      	at hudson.model.JDK.forNode(JDK.java:60)
      	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:152)
      	at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:133)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE
      

      In order to reproduce it, the bellow code can be used:

      pipeline {
          agent { node { label 'master' } }
          tools {
              jdk "openjdk12"
          }
          stages {
              stage('Build') {
                  steps {
                      sh "echo Hello World"
                  }
              }
          }
      }
      

      And the Global tool configuration should be configured as per the attached image.

            Unassigned Unassigned
            knyvel Ricardo Gato
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: