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(
    at net.sf.json.JSONObject._fromJSONTokener(
    at net.sf.json.JSONObject._fromString(
    at net.sf.json.JSONObject.fromObject(
    at net.sf.json.JSONObject.fromObject(
    at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$
    at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken$
    at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryToken.newKeyMaterialFactory(
    at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(
    at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.newKeyMaterialFactory(
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(
    at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(
    at com.cloudbees.dockerpublish.DockerBuilder.perform(
    at hudson.tasks.BuildStepMonitor$1.perform(
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(
    at hudson.model.Build$
    at hudson.model.Build$BuildExecution.doRun(
    at hudson.model.AbstractBuild$
    at hudson.model.Run.execute(
    at hudson.model.ResourceController.execute(
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.

  • Azure Docker Container - how to pass startup commands to a docker run?
  • Symfony cannot connect to mysql DB on docker ECS container
  • Getting docker working in daemon mode for a tahoe-lafs storage node?
  • UnknownHostException only on Bluemix
  • My boot2docker installation seems to not be working. What am I doing wrong?
  • Can I export a container with data and everything to spawn a complete copy on another computer?
  • I have no knowledge in java, and not sure what, the above error says

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

    Leaving the question open.
    thanks much,

  • What environment variables can be used with a Docker image?
  • Can I run Docker-in-Docker without using the --privileged flag
  • Docker daemon wont start even after adding user/deleting host environment var etc
  • how to cache post requests with varnish?
  • Cannot deploy docker containers from different hosts
  • how to configure flanneld service on kube minion
  • 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.