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

Downloading JDK from ZIP on Agent causes file not found error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: core, remoting
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      When installing a JDK as a global tool where the installable is a ZIP file, the installation fails on a remote agent but succeeds on the Jenkins master.

      Changing the ZIP file to a .tar.gz fixes the issues and works as expected on both master and agents.

      The remote agent in this case is a dynamic EC2 node.

       

       [Pipeline] tool Unpacking https://<artifactory>/somefile.zip to /home/jenkins-slave/tools/hudson.model.JDK/ibm-jdk7 on EC2 (Digital Slave - Dev) - build-application ()
       ERROR: Failed to download https://<artifactory>/somefile.zip from agent; will retry from master
       java.io.IOException: No such file or directory
       at java.io.UnixFileSystem.createFileExclusively(Native Method)
       at java.io.File.createTempFile(File.java:2026)
       at java.io.File.createTempFile(File.java:2072)
       at hudson.FilePath.unzip(FilePath.java:677)
       at hudson.FilePath.access$200(FilePath.java:213)
       at hudson.FilePath$Unpack.invoke(FilePath.java:1040)
       Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (Digital Slave - Dev) - build-application)
       at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
       at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
       at hudson.remoting.Channel.call(Channel.java:1001)
       at hudson.FilePath.act(FilePath.java:1157)
       at hudson.FilePath.act(FilePath.java:1146)
       at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1002)
       at hudson.FilePath.installIfNecessaryFrom(FilePath.java:938)
       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:148)
       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.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       at java.base/java.lang.Thread.run(Thread.java:834)
       Caused: java.io.IOException: Failed to unpack https://<artifactory>/somefile.zip (0 bytes read)
       at hudson.FilePath$Unpack.invoke(FilePath.java:1045)
       at hudson.FilePath$Unpack.invoke(FilePath.java:1030)
       at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3313)
       at hudson.remoting.UserRequest.perform(UserRequest.java:211)
       at hudson.remoting.UserRequest.perform(UserRequest.java:54)
       at hudson.remoting.Request$2.run(Request.java:375)
       at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73)
       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)[Pipeline] }
       [Pipeline] // stage
       [Pipeline] }
       [Pipeline] // withEnv
       [Pipeline] }
       [Pipeline] // withEnv
       [Pipeline] }
       [Pipeline] // node
       [Pipeline] stage
       [Pipeline]
      { (Declarative: Post Actions) [Pipeline] echoBuild completed. currentBuild.result = FAILURE[Pipeline] echoBuild failedError when executing failure post condition: groovy.lang.MissingPropertyException: No such property: jobName for class: groovy.lang.Binding at groovy.lang.Binding.getVariable(Binding.java:63) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:270) at org.kohsuke.groovy.sandbox.impl.Checker$7.call(Checker.java:353) at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:357) at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333) at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:333) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29) at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20) at WorkflowScript.run(WorkflowScript:312) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.delegateAndExecute(ModelInterpreter.groovy:137) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.runPostConditions(ModelInterpreter.groovy:756) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:395) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.catchRequiredContextForNode(ModelInterpreter.groovy:393) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.runPostConditions(ModelInterpreter.groovy:755) at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2030) at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2015) at com.cloudbees.groovy.cps.CpsDefaultGroovyMethods.each(CpsDefaultGroovyMethods:2056) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.runPostConditions(ModelInterpreter.groovy:745) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.runPostConditions(ModelInterpreter.groovy) at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.executePostBuild(ModelInterpreter.groovy:723) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74) at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30) at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66) at jdk.internal.reflect.GeneratedMethodAccessor733.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at com.cloudbees.groovy.cps.Next.step(Next.java:83) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174) at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163) at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129) at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:136) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834) [Pipeline] }
      [Pipeline] // stage
       [Pipeline] End of Pipeline
       [Bitbucket] Notifying commit build result
       [Bitbucket] Build result notified
       Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (Digital Slave - Dev) - build-application ()
       at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
       at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
       at hudson.remoting.Channel.call(Channel.java:1001)
       at hudson.FilePath.act(FilePath.java:1157)
       at hudson.FilePath.act(FilePath.java:1146)
       at hudson.FilePath.unzipFrom(FilePath.java:661)
       at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1015)
       at hudson.FilePath.installIfNecessaryFrom(FilePath.java:938)
       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:148)
       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.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       at java.base/java.lang.Thread.run(Thread.java:834)
       java.io.IOException: No such file or directory
       at java.io.UnixFileSystem.createFileExclusively(Native Method)
       at java.io.File.createTempFile(File.java:2026)
       at java.io.File.createTempFile(File.java:2072)
       at hudson.FilePath.unzip(FilePath.java:677)
       at hudson.FilePath.access$200(FilePath.java:213)
       at hudson.FilePath$UnzipFrom.invoke(FilePath.java:670)
       at hudson.FilePath$UnzipFrom.invoke(FilePath.java:663)
       at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3313)
       at hudson.remoting.UserRequest.perform(UserRequest.java:211)
       at hudson.remoting.UserRequest.perform(UserRequest.java:54)
       at hudson.remoting.Request$2.run(Request.java:375)
       at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73)
       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)
       Caused: java.io.IOException: Failed to unpack https://<artifactory>/somefile.zip
       (15239 bytes read of total 140949363)
       at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1019)
       Caused: java.io.IOException: Failed to install https://<artifactory>/somefile.zip
       to /home/jenkins-slave/tools/hudson.model.JDK/ibm-jdk7
       at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1025)
       at hudson.FilePath.installIfNecessaryFrom(FilePath.java:938)
       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:148)
       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.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
       at java.base/java.lang.Thread.run(Thread.java:834)
       Finished: FAILURE
        
      

       

        Attachments

          Activity

          Hide
          jthompson Jeff Thompson added a comment -

          Thanks for clarifying Riain Condon . It would be great if you can determine any more about what is going on here.

          It shouldn't have anything to do with recent changes. There were changes involving zip, but none that should have affected unzip. It's especially weird that tar.gz works but zip doesn't as they go through very similar code paths.

          Show
          jthompson Jeff Thompson added a comment - Thanks for clarifying Riain Condon . It would be great if you can determine any more about what is going on here. It shouldn't have anything to do with recent changes. There were changes involving zip, but none that should have affected unzip. It's especially weird that tar.gz works but zip doesn't as they go through very similar code paths.
          Hide
          stetchy Riain Condon added a comment -

          Daniel Beck I'll have a look and see where the temp directory is. It's strange though that the Maven install works fine, it is a tar though. I'll see if changing it to a zip results in the same.

          Jeff Thompson Yeah. I noticed in the logs that when the first error occurs it says it is at zero bytes downloaded, then the second printing of the error has a > 0 amount of bytes retrieved. It's hardly trying to prematurely expand the zip file on the remote is it?

          Show
          stetchy Riain Condon added a comment - Daniel Beck I'll have a look and see where the temp directory is. It's strange though that the Maven install works fine, it is a tar though. I'll see if changing it to a zip results in the same. Jeff Thompson Yeah. I noticed in the logs that when the first error occurs it says it is at zero bytes downloaded, then the second printing of the error has a > 0 amount of bytes retrieved. It's hardly trying to prematurely expand the zip file on the remote is it?
          Hide
          danielbeck Daniel Beck added a comment -

          It's strange though that the Maven install works fine, it is a tar though.

          Not strange: Untaring doesn't go through a file in the temp dir.

          Show
          danielbeck Daniel Beck added a comment - It's strange though that the Maven install works fine, it is a tar though. Not strange: Untaring doesn't go through a file in the temp dir.
          Hide
          stetchy Riain Condon added a comment -

          Daniel Beck you were spot on with the temp dir. We specified it via a JVM argument and the creation of the dir didn't succeed in the AMI bake, so it caused the error above. Sorry for the red herring

          Show
          stetchy Riain Condon added a comment - Daniel Beck  you were spot on with the temp dir. We specified it via a JVM argument and the creation of the dir didn't succeed in the AMI bake, so it caused the error above. Sorry for the red herring
          Hide
          danielbeck Daniel Beck added a comment -

          Glad you found the cause.

          Show
          danielbeck Daniel Beck added a comment - Glad you found the cause.

            People

            Assignee:
            jthompson Jeff Thompson
            Reporter:
            stetchy Riain Condon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: