Jenkins amazon-ecr plugin issue

I’m using amazon-ecr plugin for Jenkins, it went well for a long time and suddenly broke today

ERROR: Build step failed with exception
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:404)
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(DockerBuilder.java:382)
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:326)
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:274)
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:254)
    at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:225)
    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 'Docker Build and Publish' marked build as failure
Finished: FAILURE 

Docker Build runs fine, if I remove the ECR auth and fails only at push.

  • django docker-compose --> memcached not working
  • expected cgroupsPath to be of format \“slice:prefix:name\” for systemd cgroups
  • docker for windows mount a folder but can't open it after several hours
  • Docker in “host” networking mode does not bind ports to the host
  • Published k8s service is not available
  • mount points added to the host don't show up in a running docker container
  • I have no knowledge in java, and not sure what, the above error says

    Update
    This feels to be a issue with Jenkins upgrade. Installing fresh Jenkins and amazon-ecr does work fine.

    Leaving the question open.
    thanks much,
    Shan

  • Docker, Cannot connect to the Docker daemon. Is the docker daemon running on this host?
  • Gitlab CI / Docker: Use custom image for job
  • Could not call another container using its name as host in docker-compose
  • Running PHPUnit within a Docker container with PhpStorm
  • How to set up container network by connman in container environment?
  • Setting docker environment variable to existing environment variable with different name
  • One Solution collect form web for “Jenkins amazon-ecr plugin issue”

    /var/lib/jenkins/.dockercfg might become blank for some reason.

    Try removing that file and rerunning build job.

    That should generate new .dockercfg file and the issue will be fixed.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.