java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Docker v1.10.0 introduced a new format for image IDs whereby they now have a prefix of {{sha256:}} before the hash. See https://github.com/docker/docker/pull/17924 under *Summary of UI Changes*: {quote} Full-length image IDs have a sha256: prefix. This prefix is hidden for truncated image IDs for convenience. {quote} This is causing my jobs that rely on building and pushing Docker images to fail. It builds the image fine, but when it goes to push it to the repository it apparently first validates the image ID by making sure it's a string with a length of 64. The length check is now failing, since the full image ID now contains the {{sha256:}} prefix. The relevant file and line where this check is occurring is [/src/main/java/org/jenkinsci/plugins/docker/commons/fingerprint/DockerFingerprints.java#L64|https://github.com/jenkinsci/docker-commons-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/commons/fingerprint/DockerFingerprints.java#L64] The error in my build log is: {code} ... Successfully built 8d6d5e96d600 [api-dev] $ docker inspect 8d6d5e96d600 ERROR: Build step failed with exception java.lang.IllegalArgumentException: Expecting 64-char full image ID, but got sha256:2f469c13a10a9950c6c5ed4d5cccd6f7b13e2a7516a62103d98e98a838e60d1a at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.getFingerprintHash(DockerFingerprints.java:65) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forDockerInstance(DockerFingerprints.java:141) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:108) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:93) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.addFromFacet(DockerFingerprints.java:253) at com.cloudbees.dockerpublish.DockerBuilder$Perform.processFingerprints(DockerBuilder.java:467) at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:339) 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 {code} I'm not sure what the usefulness of the length check is, but it should either be removed or updated to account for the new prefix in the full image ID.
    via by Sarah Ryan,
  • Docker v1.10.0 introduced a new format for image IDs whereby they now have a prefix of {{sha256:}} before the hash. See https://github.com/docker/docker/pull/17924 under *Summary of UI Changes*: {quote} Full-length image IDs have a sha256: prefix. This prefix is hidden for truncated image IDs for convenience. {quote} This is causing my jobs that rely on building and pushing Docker images to fail. It builds the image fine, but when it goes to push it to the repository it apparently first validates the image ID by making sure it's a string with a length of 64. The length check is now failing, since the full image ID now contains the {{sha256:}} prefix. The relevant file and line where this check is occurring is [/src/main/java/org/jenkinsci/plugins/docker/commons/fingerprint/DockerFingerprints.java#L64|https://github.com/jenkinsci/docker-commons-plugin/blob/master/src/main/java/org/jenkinsci/plugins/docker/commons/fingerprint/DockerFingerprints.java#L64] The error in my build log is: {code} ... Successfully built 8d6d5e96d600 [api-dev] $ docker inspect 8d6d5e96d600 ERROR: Build step failed with exception java.lang.IllegalArgumentException: Expecting 64-char full image ID, but got sha256:2f469c13a10a9950c6c5ed4d5cccd6f7b13e2a7516a62103d98e98a838e60d1a at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.getFingerprintHash(DockerFingerprints.java:65) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forDockerInstance(DockerFingerprints.java:141) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:108) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:93) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.addFromFacet(DockerFingerprints.java:253) at com.cloudbees.dockerpublish.DockerBuilder$Perform.processFingerprints(DockerBuilder.java:467) at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:339) 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 {code} I'm not sure what the usefulness of the length check is, but it should either be removed or updated to account for the new prefix in the full image ID.
    via by Sarah Ryan,
  • After upgrading docker-engine from 1.9.1 to 1.10.2 we encountered the same Docker ID problem as in issue [https://issues.jenkins-ci.org/browse/JENKINS-32792] even tough we've upgraded docker-commons to version 1.3.1: Output from docker inspect: {code:java} $ docker inspect --type=image --format='{{json .Id}}' 598d0def97f1 "sha256:598d0def97f180366008bcddbf0a4ed5267b35d0a876c0f867fc38c7adb041e3" Error msg: Status: Image is up to date for mongo:latest ---> 598d0def97f1 Successfully built 598d0def97f1 [database] $ docker inspect 598d0def97f1 ERROR: Build step failed with exception java.lang.IllegalArgumentException: Expecting 64-char full image ID, but got at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.getFingerprintHash(DockerFingerprints.java:71) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forDockerInstance(DockerFingerprints.java:147) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:114) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:99) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.addFromFacet(DockerFingerprints.java:259) at com.cloudbees.dockerpublish.DockerBuilder$Perform.processFingerprints(DockerBuilder.java:490) at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:364) at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:294) at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:274) at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:245) at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105) at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:133) 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) {code}
    via by Martin Achtman,
  • After upgrading docker-engine from 1.9.1 to 1.10.2 we encountered the same Docker ID problem as in issue [https://issues.jenkins-ci.org/browse/JENKINS-32792] even tough we've upgraded docker-commons to version 1.3.1: Output from docker inspect: {code:java} $ docker inspect --type=image --format='{{json .Id}}' 598d0def97f1 "sha256:598d0def97f180366008bcddbf0a4ed5267b35d0a876c0f867fc38c7adb041e3" Error msg: Status: Image is up to date for mongo:latest ---> 598d0def97f1 Successfully built 598d0def97f1 [database] $ docker inspect 598d0def97f1 ERROR: Build step failed with exception java.lang.IllegalArgumentException: Expecting 64-char full image ID, but got at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.getFingerprintHash(DockerFingerprints.java:71) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forDockerInstance(DockerFingerprints.java:147) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:114) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:99) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.addFromFacet(DockerFingerprints.java:259) at com.cloudbees.dockerpublish.DockerBuilder$Perform.processFingerprints(DockerBuilder.java:490) at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:364) at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:294) at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:274) at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:245) at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110) at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154) at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105) at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:133) 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) {code}
    via by Martin Achtman,
    • java.lang.IllegalArgumentException: Expecting 64-char full image ID, but got sha256:2f469c13a10a9950c6c5ed4d5cccd6f7b13e2a7516a62103d98e98a838e60d1a at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.getFingerprintHash(DockerFingerprints.java:65) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forDockerInstance(DockerFingerprints.java:141) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:108) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.forImage(DockerFingerprints.java:93) at org.jenkinsci.plugins.docker.commons.fingerprint.DockerFingerprints.addFromFacet(DockerFingerprints.java:253) at com.cloudbees.dockerpublish.DockerBuilder$Perform.processFingerprints(DockerBuilder.java:467) at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:339) 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)
    No Bugmate found.