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

JSONException: null object when 'auths' key is not exist in .docker/config.json file.

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Component/s: docker-commons-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 2.73
      Docker Commons Plugin v1.8
      Docker Build and Publish plugin v1.3.2
    • Similar Issues:

      Description

      If there is config file for docker at `~/.docker/config.json` and no `auths` key in the file, this plugin throws 'JSONException: null object'

      This exception needs to be avoided.

       

      ERROR: Build step failed with exception
      net.sf.json.JSONException: null object
      	at net.sf.json.JSONObject.verifyIsNull(JSONObject.java:2688)
      	at net.sf.json.JSONObject.element(JSONObject.java:1733)
      	at net.sf.json.JSONObject.element(JSONObject.java:1716)
      	at net.sf.json.JSONObject.put(JSONObject.java:2328)
      	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$1.call(DockerRegistryToken.java:109)
      	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$1.call(DockerRegistryToken.java:82)
      	at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
      	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken.newKeyMaterialFactory(DockerRegistryToken.java:82)
      	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:219)
      	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:204)
      	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(DockerRegistryEndpoint.java:196)
      	at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:455)
      	at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:431)
      	at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:373)
      	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:730)
      	at hudson.model.Build$BuildExecution.build(Build.java:206)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:490)
      	at hudson.model.Run.execute(Run.java:1737)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:419)
      

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            Do not plan to work on that since the new APIs normally call docker login and do not use that code path.

            Show
            jglick Jesse Glick added a comment - Do not plan to work on that since the new APIs normally call docker login and do not use that code path.
            Hide
            jglick Jesse Glick added a comment -
            Show
            jglick Jesse Glick added a comment - See JENKINS-51407 .

              People

              • Assignee:
                csanchez Carlos Sanchez
                Reporter:
                shyr stephen moon
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: