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

Jenkins **Post Build Actions**, **Stop Docker Containers** failing

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      When using the Jenkins Post Build Actions, Stop Docker Containers, after successfully starting the container, then trying to stop it after the build, I am getting a build failure with the stack trace listed below.

      Starting container a57dce71ff0dcf78bbfaa5daaad88d1e3d40ed9477556235127348cf359a3e5c, cloud docker

      Stopping all containers
      Stopping container a57dce71ff0dcf78bbfaa5daaad88d1e3d40ed9477556235127348cf359a3e5c
      ERROR: Build step failed with exception
      com.github.dockerjava.api.exception.NotModifiedException:
      at com.github.dockerjava.netty.handler.HttpResponseHandler.channelRead0(HttpResponseHandler.java:97)
      at com.github.dockerjava.netty.handler.HttpResponseHandler.channelRead0(HttpResponseHandler.java:33)
      at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
      at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
      at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
      at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:287)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
      at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
      at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
      at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
      at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
      at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
      at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
      at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
      at java.lang.Thread.run(Thread.java:748)
      Caused: java.lang.RuntimeException
      at com.nirima.jenkins.plugins.docker.publisher.DockerPublisherControl.perform(DockerPublisherControl.java:47)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1073)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
      at hudson.model.Run.execute(Run.java:1752)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      Build step 'Stop Docker Containers' marked build as failure

        Attachments

          Activity

          Hide
          roso67 Roger Soucy added a comment -

          I have attached 2 config.xml files that I used for testing purposes.

          config1.xml.txt is a maven project type that has a Pre Steps, Start\Stop Docker Containers configured to provision and start a container. It also has a Post Build Actions to Stop Docker Containers. Removed Stopped Containers is checked. This configuration fails with the stacktrace I supplied in my original comment.

          config2.xml.txt is a freestyle project type that has a Build step, Start\Stop Docker Containers configured to provision and start a container. It also has a Post Build Actions to Stop Docker Containers. Removed Stopped Containers is checked. This configuration does not fail and removes the container fully. Meaning when I do docker ps -a the container is no longer listed.

          Show
          roso67 Roger Soucy added a comment - I have attached 2 config.xml files that I used for testing purposes. config1.xml.txt is a maven project type that has a Pre Steps , Start\Stop Docker Containers configured to provision and start a container. It also has a Post Build Actions to Stop Docker Containers . Removed Stopped Containers is checked. This configuration fails with the stacktrace I supplied in my original comment. config2.xml.txt is a freestyle project type that has a Build step, Start\Stop Docker Containers configured to provision and start a container. It also has a Post Build Actions to Stop Docker Containers . Removed Stopped Containers is checked. This configuration does not fail and removes the container fully. Meaning when I do docker ps -a the container is no longer listed.

            People

            • Assignee:
              vjuranek vjuranek
              Reporter:
              roso67 Roger Soucy
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: