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

NPE when trying to pull Docker image as first build step

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • None

      Steps to Reproduce:

      1. With the above installed, create a job with "Execute Docker command" which does:

      Pull Image

      Name: owasp/zap2docker-weekly
      Tag: latest
      Registry: [blank[ or Docker
      Docker Registry URL; https://hub.docker.com/r/owasp/zap2docker-weekly/
      Registry Credentials: [none]

      2. In Jenkins, click "Build Now"

      Actual Results:

      I get the following stack trace/exception:

      Started by user anonymous
      Building in workspace /var/lib/jenkins/workspace/Docker-ZAP
      > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
      > /usr/bin/git config remote.origin.url https://github.com/stephendonner/docker-zap.git # timeout=10
      Fetching upstream changes from https://github.com/stephendonner/docker-zap.git
      > /usr/bin/git --version # timeout=10
      > /usr/bin/git -c core.askpass=true fetch --tags --progress https://github.com/stephendonner/docker-zap.git +refs/heads/:refs/remotes/origin/
      > /usr/bin/git rev-parse refs/remotes/origin/master^

      {commit} # timeout=10
      > /usr/bin/git rev-parse refs/remotes/origin/origin/master^{commit}

      # timeout=10
      Checking out Revision 827ab1e2eb5888f8b612610fe3f6b9f62f7e219f (refs/remotes/origin/master)
      > /usr/bin/git config core.sparsecheckout # timeout=10
      > /usr/bin/git checkout -f 827ab1e2eb5888f8b612610fe3f6b9f62f7e219f
      > /usr/bin/git rev-list 827ab1e2eb5888f8b612610fe3f6b9f62f7e219f # timeout=10
      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at com.github.dockerjava.jaxrs.DockerCmdExecFactoryImpl.init(DockerCmdExecFactoryImpl.java:105)
      at com.github.dockerjava.core.DockerClientImpl.withDockerCmdExecFactory(DockerClientImpl.java:64)
      at com.github.dockerjava.core.DockerClientBuilder.build(DockerClientBuilder.java:63)
      at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.createDockerClient(DockerBuilder.java:132)
      at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:204)
      at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:68)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      at hudson.model.Build$BuildExecution.build(Build.java:205)
      at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Build step 'Execute Docker command' marked build as failure
      Finished: FAILURE

            vjuranek vjuranek
            stephendonner Stephen Donner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: