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

Docker Build and Publish not building

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Trying to build my docker image into a docker registry and I get this

      net.sf.json.JSONException: A JSONObject text must begin with '{' at character 0 of
      at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:499)
      at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:919)
      at net.sf.json.JSONObject._fromString(JSONObject.java:1145)
      at net.sf.json.JSONObject.fromObject(JSONObject.java:162)
      at net.sf.json.JSONObject.fromObject(JSONObject.java:132)
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$1.call(DockerRegistryToken.java:91)
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$1.call(DockerRegistryToken.java:71)
      at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken.newKeyMaterialFactory(DockerRegistryToken.java:71)
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:204)
      at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:193)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:458)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:434)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:376)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:311)
      at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291)
      at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      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:1720)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:404)
      Build step 'Docker Build and Publish' marked build as failure

        Attachments

          Issue Links

            Activity

            Hide
            csanchez Carlos Sanchez added a comment -

            Please don't open duplicate issues.
            What version of Docker, registry, jenkins,... are you using?

            Show
            csanchez Carlos Sanchez added a comment - Please don't open duplicate issues. What version of Docker, registry, jenkins,... are you using?
            Hide
            vbtapper Evanilson Abril added a comment -

            Docker version 1.12.1
            Jenkins version 2.7.2 LTS

            Show
            vbtapper Evanilson Abril added a comment - Docker version 1.12.1 Jenkins version 2.7.2 LTS
            Hide
            vbtapper Evanilson Abril added a comment -

            Docker Commons Plugin 1.4.0
            CloudBees Docker Build and Publish plugin 1.3.1

            Show
            vbtapper Evanilson Abril added a comment - Docker Commons Plugin 1.4.0 CloudBees Docker Build and Publish plugin 1.3.1
            Hide
            vbtapper Evanilson Abril added a comment -

            Are u able to help or not ? I need to update my products

            Show
            vbtapper Evanilson Abril added a comment - Are u able to help or not ? I need to update my products
            Hide
            thorndike Armin Rauch added a comment -

            I got the same helpfull error message. Turns out that the user lost the login information to my private registry. After manually doing a docker login for that user everything started working again.

            Show
            thorndike Armin Rauch added a comment - I got the same helpfull error message. Turns out that the user lost the login information to my private registry. After manually doing a docker login for that user everything started working again.
            Hide
            lchigami Lucas Chigami added a comment - - edited

            I'm having the same problem with my Jenkins server. Running the WAR inside a Tomcat8 server.

            UPDATE: In my case, the problem was an archive located at /usr/share/tomcat8 named .dockercfg
            I don't know why, but when the credentials were inserted in the job at Jenkins to upload the docker image to my self-hosted Registry service, this file was always blank. So I deleted this file, ran again the Jenkins job, and voila, success!

            Show
            lchigami Lucas Chigami added a comment - - edited I'm having the same problem with my Jenkins server. Running the WAR inside a Tomcat8 server. UPDATE: In my case, the problem was an archive located at /usr/share/tomcat8 named .dockercfg I don't know why, but when the credentials were inserted in the job at Jenkins to upload the docker image to my self-hosted Registry service, this file was always blank. So I deleted this file, ran again the Jenkins job, and voila, success!
            Hide
            rbedia Rafael Bedia added a comment -

            This happened to me after the Jenkins agent running Docker ran out of disk space. In the Jenkins agent user's home directory .docker/config.json was a zero length file. Deleting the file and rerunning the build fixed the problem.

            Show
            rbedia Rafael Bedia added a comment - This happened to me after the Jenkins agent running Docker ran out of disk space. In the Jenkins agent user's home directory .docker/config.json was a zero length file. Deleting the file and rerunning the build fixed the problem.
            Hide
            benharack Ben Harack added a comment -

            In addition to the step described above, I also had to re-login to my container repository. So for me that took the following form:

            aws ecr get-login

            Where I then had to actually log in with the provided command. After that login, the next build worked.

            Show
            benharack Ben Harack added a comment - In addition to the step described above, I also had to re-login to my container repository. So for me that took the following form: aws ecr get-login Where I then had to actually log in with the provided command. After that login, the next build worked.

              People

              Assignee:
              csanchez Carlos Sanchez
              Reporter:
              vbtapper Evanilson Abril
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: