Open timja opened 5 years ago
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.
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.
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
We have that problem periodically when our agents dinamically deployed in openshift.
Jenkins 2.235.5, kubernetes plugin 1.27.5
13:37:35 [withMaven] using JDK installation openjdk-1.8.0-linux 13:37:35 Unpacking https://somelocalnexus/jenkins/openjdk-1.8.0-linux.tar.gz to /home/jenkins/agent/tools/hudson.model.JDK/openjdk-1.8.0-linux on massive-os-6f51l 13:37:40 ERROR: Failed to download https://somelocalnexus/jenkins/openjdk-1.8.0-linux.tar.gz from agent; will retry from master 13:37:40 java.nio.file.NoSuchFileException: /home/jenkins/agent/tools/hudson.model.JDK/openjdk-1.8.0-linux/openjdk-1.8.0/jre/lib/amd64/server/classes.jsa 13:37:40 at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) 13:37:40 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) 13:37:40 at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) 13:37:40 at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) 13:37:40 at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) 13:37:40 at java.nio.file.Files.newOutputStream(Files.java:216) 13:37:40 at hudson.util.IOUtils.copy(IOUtils.java:42) 13:37:40 at hudson.FilePath.readFromTar(FilePath.java:2602) 13:37:40 Caused: java.io.IOException: Failed to extract input stream 13:37:40 at hudson.FilePath.readFromTar(FilePath.java:2612) 13:37:40 at hudson.FilePath.access$500(FilePath.java:211) 13:37:40 at hudson.FilePath$Unpack.invoke(FilePath.java:954) 13:37:40 Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from somelocaljenkins/somelocalip:47420 13:37:40 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788) 13:37:40 at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356) 13:37:40 at hudson.remoting.Channel.call(Channel.java:998) 13:37:40 at hudson.FilePath.act(FilePath.java:1069) 13:37:40 at hudson.FilePath.act(FilePath.java:1058) 13:37:40 at hudson.FilePath.installIfNecessaryFrom(FilePath.java:914) 13:37:40 at hudson.FilePath.installIfNecessaryFrom(FilePath.java:850) 13:37:40 at hudson.tools.ZipExtractionInstaller.performInstallation(ZipExtractionInstaller.java:83) 13:37:40 at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:69) 13:37:40 at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109) 13:37:40 at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:206) 13:37:40 at hudson.model.JDK.forNode(JDK.java:148) 13:37:40 at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.setupJDK(WithMavenStepExecution2.java:290) 13:37:40 at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.doStart(WithMavenStepExecution2.java:194) 13:37:40 at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77) 13:37:40 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 13:37:40 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 13:37:40 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 13:37:40 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 13:37:40 Caused: java.io.IOException: Failed to unpack https://somelocalnexus/jenkins/openjdk-1.8.0-linux.tar.gz (53804998 bytes read) 13:37:40 at hudson.FilePath$Unpack.invoke(FilePath.java:957) 13:37:40 at hudson.FilePath$Unpack.invoke(FilePath.java:942) 13:37:40 at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3073) 13:37:40 at hudson.remoting.UserRequest.perform(UserRequest.java:211) 13:37:40 at hudson.remoting.UserRequest.perform(UserRequest.java:54) 13:37:40 at hudson.remoting.Request$2.run(Request.java:369) 13:37:40 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 13:37:40 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 13:37:40 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 13:37:40 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 13:37:40 at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:97) 13:37:40 at java.lang.Thread.run(Thread.java:748) [Pipeline] // withMaven [Pipeline] } [Pipeline] // nodejs
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:
In order to reproduce it, the bellow code can be used:
And the Global tool configuration should be configured as per the attached image.
Originally reported by knyvel, imported from: GlobalTool JDK installation (via extract installer) fails for JDK12 onwards