[JIRA] (JENKINS-59772) GlobalTool JDK installation (via extract installer) fails for JDK12 onwards

4 views
Skip to first unread message

ricardo.gato@swisscom.com (JIRA)

unread,
Oct 14, 2019, 3:19:02 AM10/14/19
to jenkinsc...@googlegroups.com
Ricardo Gato created an issue
 
Jenkins / Bug JENKINS-59772
GlobalTool JDK installation (via extract installer) fails for JDK12 onwards
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: Screenshot 2019-10-14 at 09.16.58.png
Components: core
Created: 2019-10-14 07:18
Priority: Minor Minor
Reporter: Ricardo Gato

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.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

ricardo.gato@swisscom.com (JIRA)

unread,
Oct 14, 2019, 3:20:02 AM10/14/19
to jenkinsc...@googlegroups.com
Ricardo Gato commented on Bug JENKINS-59772
 
Re: GlobalTool JDK installation (via extract installer) fails for JDK12 onwards

The issue is caused, due to the existence of the classes.jsa file, introduced after JDK11. The unzipping process will abort, as soon as it reaches this file.

It does not matter the location/content of the classes.jsa file inside the zip - i tested several combinations; as soon as the file is renamed to something else, the unzipping will work.

dbeck@cloudbees.com (JIRA)

unread,
Oct 14, 2019, 8:09:03 PM10/14/19
to jenkinsc...@googlegroups.com

Running

docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:2.190.1 

and this pipeline (different tool name, got that one wrong in tool config), produces

Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/jenkins_home/workspace/pl
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Tool Install)
[Pipeline] tool
Unpacking https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_osx-x64_bin.tar.gz to /var/jenkins_home/tools/hudson.model.JDK/jdk12 on Jenkins
[Pipeline] envVarsForTool
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ echo Hello World
Hello World
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS 

Indicating the problem here is likely environmental.

dbeck@cloudbees.com (JIRA)

unread,
Oct 14, 2019, 8:10:03 PM10/14/19
to jenkinsc...@googlegroups.com
Daniel Beck closed an issue as Cannot Reproduce
 
Change By: Daniel Beck
Status: Open Closed
Resolution: Cannot Reproduce

dbeck@cloudbees.com (JIRA)

unread,
Oct 14, 2019, 8:16:02 PM10/14/19
to jenkinsc...@googlegroups.com
 
Re: GlobalTool JDK installation (via extract installer) fails for JDK12 onwards

Also retried it on the host Mac OS system, and got

Started by user admin
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /Users/danielbeck/Jenkins/Homes/jdk-home/workspace/pl
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Tool Install)
[Pipeline] tool
Unpacking https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_osx-x64_bin.tar.gz to /Users/danielbeck/Jenkins/Homes/jdk-home/tools/hudson.model.JDK/openjdk12 on Jenkins
[Pipeline] envVarsForTool
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] tool
[Pipeline] envVarsForTool
[Pipeline] withEnv
[Pipeline] {
[Pipeline] sh
+ echo Hello World
Hello World
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS 
Add Comment Add Comment
 
Reply all
Reply to author
Forward
0 new messages