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

docker.build throw IOExceptions with some sources

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • docker-workflow-plugin
    • None
    • CloudBees Docker Workflow 1.2
      Workflow 1.10.1
      Jenkins 1.631
      centos7

      When we use some images like 'centos:centos7', 'nodesource/centos7:0.12.7' or 'nodesource/jessie:0.12.7', it throws an exception when try to inspect the Id from the source:

      Example:
      FROM nodesource/centos7:0.12.7

      RUN yum install -y epel-release
      RUN yum install -y npm

      Exception:
      Running: Record trace of a Docker image used in FROM
      Running: Allocate node : Body : End
      Running: Allocate node : End
      Running: End of Workflow
      java.io.IOException: Cannot retrieve .Id from 'docker inspect centos:centos7'
      at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:176)
      at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:114)
      at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:74)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:136)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:112)

      Thanks,
      Henrique

          [JENKINS-31507] docker.build throw IOExceptions with some sources

          Henrique Amaral created issue -
          Jesse Glick made changes -
          Component/s New: docker-workflow-plugin [ 20625 ]
          Component/s Original: workflow-plugin [ 18820 ]

          Jesse Glick added a comment -

          Hmm,

          $ docker inspect -f '{{.Id}}' centos:centos7
          ae0c2d0bdc100993f7093400f96e9abab6ddd9a7c56b0ceba47685df5a8fe906
          

          works for me. What does docker version say? Do you have a self-contained script to reproduce?

          Jesse Glick added a comment - Hmm, $ docker inspect -f '{{.Id}}' centos:centos7 ae0c2d0bdc100993f7093400f96e9abab6ddd9a7c56b0ceba47685df5a8fe906 works for me. What does docker version say? Do you have a self-contained script to reproduce?

          Hi Jesse, it worked when you run with the terminal, only fails when you run from the workflow-docker-plugin.
          The docker version is: 1.8.3

          Henrique Amaral added a comment - Hi Jesse, it worked when you run with the terminal, only fails when you run from the workflow-docker-plugin. The docker version is: 1.8.3

          Jesse Glick added a comment -

          Interesting, should just be running that command internally. Will check if I can reproduce. Do you have only one version of Docker installed on the system?

          Jesse Glick added a comment - Interesting, should just be running that command internally. Will check if I can reproduce. Do you have only one version of Docker installed on the system?

          Yes, I have only one version running in a CentOS 7 and the CentOS is a jenkins slave.

          Henrique Amaral added a comment - Yes, I have only one version running in a CentOS 7 and the CentOS is a jenkins slave.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 166912 ] New: JNJira + In-Review [ 182512 ]

          Josh Marston added a comment -

          I just got the same issue building from centos:centos7 on a Jenkins slave:

          java.io.IOException: Cannot retrieve .Id from 'docker inspect[REPO] -t [TAG]'
          at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:184)
          at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:116)
          at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:76)
          at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:178)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:124)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:117)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16)

          Any workaround for this?

          Josh Marston added a comment - I just got the same issue building from centos:centos7 on a Jenkins slave: java.io.IOException: Cannot retrieve .Id from 'docker inspect [REPO] -t [TAG] ' at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:184) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:116) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:76) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40) at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:178) at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:124) at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:117) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16) Any workaround for this?

          Bryan Hunt added a comment -

          I have just run into this problem. I have several projects that all use the same function to build a docker image. The one I set up a few minutes ago is throwing this same exception. The other projects seem to build fine.

          java.io.IOException: Cannot retrieve .Id from 'docker inspect      gpuwa-docker.nvidia.com/java:8u102-1.1.0'
          	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:190)
          	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:119)
          	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:75)
          	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
          	at hudson.security.ACL.impersonate(ACL.java:221)
          	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
          	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:1142)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          	at java.lang.Thread.run(Thread.java:745)
          

          Bryan Hunt added a comment - I have just run into this problem. I have several projects that all use the same function to build a docker image. The one I set up a few minutes ago is throwing this same exception. The other projects seem to build fine. java.io.IOException: Cannot retrieve .Id from 'docker inspect gpuwa-docker.nvidia.com/java:8u102-1.1.0' at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:190) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:119) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:75) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52) at hudson.security.ACL.impersonate(ACL.java:221) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745)

          Jesse Glick added a comment -

          The extra whitespace looks suspicious, perhaps you have FROM␣␣␣␣something? As usual, a self-contained, minimal, reproducible test case would expedite a fix (as well as possibly make a workaround obvious).

          Jesse Glick added a comment - The extra whitespace looks suspicious, perhaps you have FROM␣␣␣␣something ? As usual, a self-contained, minimal, reproducible test case would expedite a fix (as well as possibly make a workaround obvious).

            jglick Jesse Glick
            henamaral Henrique Amaral
            Votes:
            19 Vote for this issue
            Watchers:
            26 Start watching this issue

              Created:
              Updated: