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

docker-build-step Plugin fails on docker command "Start container(s)" since 2.7

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • None
    • Jenkins 2.277.3 - docker build step plugin 2.7

    Description

      Since upgrading docker build step plugin to 2.7 the build step "Starting container(s)" fails with:

      [Docker] ERROR: failed to stop all containers
      ERROR: Build step failed with exception
      com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.lang.Object and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.github.dockerjava.api.command.InspectContainerResponse["Config"]>com.github.dockerjava.api.model.ContainerConfig["ExposedPorts"]>java.util.HashMap["5432/tcp"])

      Similar jobs fail as well. Downgrading to 2.6 makes all jobs running succesful again.

      Attachments

        Activity

          mlechner Marco Lechner added a comment -

          this behaviour still exists with docker-build-step 2.8 on

          • jenkins 2.319.1

          with

          • Jackson 2 API 2.13.0-230.v59243c64b0a5
          • Docker API Plugin 3.1.5.2
          • Docker commons plugin 1.17
          mlechner Marco Lechner added a comment - this behaviour still exists with docker-build-step 2.8 on jenkins 2.319.1 with Jackson 2 API 2.13.0-230.v59243c64b0a5 Docker API Plugin 3.1.5.2 Docker commons plugin 1.17
          balthes Balthasar Nebel added a comment - - edited

          We ran into it after upgrade of Jenkins to 2.319.3 and upgrade all Plugins to latest (build step upgrade from 2.3 to 2.8) at 11th Feb 22. We tried to revert back to 2.3, which got offered by Jenkins, but this did not work. Then we tried to manually install version 2.6, but it did not work this way. In the end we reverted all plugins to the backed up versions and will now have to wait until this issue gets solved.

          balthes Balthasar Nebel added a comment - - edited We ran into it after upgrade of Jenkins to 2.319.3 and upgrade all Plugins to latest (build step upgrade from 2.3 to 2.8) at 11th Feb 22. We tried to revert back to 2.3, which got offered by Jenkins, but this did not work. Then we tried to manually install version 2.6, but it did not work this way. In the end we reverted all plugins to the backed up versions and will now have to wait until this issue gets solved.

          This issue is also present when using the "Create Container" command and as the error message states "to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS". So, the error message provides the solution.

          Based on this stackoverflow post and looking at CreateContainerCommand.java at line 231, would simply adding FAIL_ON_EMPTY_BEANS to false after line 231 fix this issue ? Or is there something else to consider ?

                      ObjectMapper mapper = new ObjectMapper();
                      mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
                      InspectContainerResponse inspectResp = mapper.readValue(inspectRespSerialized, InspectContainerResponse.class);
          

          P.S. I'm not very good in JAVA, so this is more of a hint on my part.

          mrbluebear MisterBlueBear added a comment - This issue is also present when using the "Create Container" command and as the error message states " to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS ". So, the error message provides the solution. Based on this stackoverflow post and looking at CreateContainerCommand.java at line 231, would simply adding FAIL_ON_EMPTY_BEANS to false after line 231 fix this issue ? Or is there something else to consider ? ObjectMapper mapper = new ObjectMapper(); mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); InspectContainerResponse inspectResp = mapper.readValue(inspectRespSerialized, InspectContainerResponse.class); P.S. I'm not very good in JAVA, so this is more of a hint on my part.

          I created the PR #80 with fixes on Start and Create that disable this behavior by configuring the mapper to disable the FAIL_ON_EMPTY_BEANS error.

          mrbluebear MisterBlueBear added a comment - I created the PR #80 with fixes on Start and Create that disable this behavior by configuring the mapper to disable the FAIL_ON_EMPTY_BEANS error.

          People

            vjuranek vjuranek
            mlechner Marco Lechner
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: