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

Job fails due to timeout when destroying docker container

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • docker-workflow-plugin
    • None
    • Jenkins ver. 2.32.1
      Docker Pipeline ver. 1.10

      Since the last update (version 1.10, which included a timeout for docker operations - commit 3f8a83fbacdce1e3d286cf1790182a89d9f6cd11), our pipelines began to fail at the end of a stage, when removing the temporary container.

      The steps run inside the container are executed without a problem (and take several minutes), but when the plugin stops and removes the container created to run commands inside, the 10s timeout ends the build as failure.

      My suggestion would be to remove the timeout for this operation, or not to fail the build when it happens (it is just removing a temporary container, after what really matters was executed successfully).

       

      PS: when rolled back to Docker Pipeline 1.9.1, everything worked back as it should.

       

      Below are the related log entries of one job that represent this problem:

      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      $ docker stop --time=1 033ff889f75dad2e4d59fdc7e31a604bb352da84eda43e7c3f4803bbfc3bf338
      $ docker rm -f 033ff889f75dad2e4d59fdc7e31a604bb352da84eda43e7c3f4803bbfc3bf338
      ERROR: Timeout after 10 seconds
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      java.io.IOException: Failed to rm container '033ff889f75dad2e4d59fdc7e31a604bb352da84eda43e7c3f4803bbfc3bf338'.
      at org.jenkinsci.plugins.docker.workflow.client.DockerClient.rm(DockerClient.java:158)
      at org.jenkinsci.plugins.docker.workflow.client.DockerClient.stop(DockerClient.java:145)
      at org.jenkinsci.plugins.docker.workflow.WithContainerStep.destroy(WithContainerStep.java:107)
      at org.jenkinsci.plugins.docker.workflow.WithContainerStep.access$400(WithContainerStep.java:74)
      at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Callback.finished(WithContainerStep.java:302)
      at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
      at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
      at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
      at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:146)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
      at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
      at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:165)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:328)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:80)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:240)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:228)
      at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      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)
      Finished: FAILURE

        

            Unassigned Unassigned
            soreve Bernardo Severo
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: