{"record":{"id":"c1b4fec7d1448c22","repo":"spring-projects/spring-boot","slug":"error-response-received-when-pushing-image","errorCode":null,"errorMessage":"Error response received when pushing image: {}","messagePattern":"Error response received when pushing image: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java","lineNumber":631,"sourceCode":"\n\t\tprivate void assertValidResponseReceived() {\n\t\t\tAssert.state(StringUtils.hasText(this.stream),\n\t\t\t\t\t() -> \"Invalid response received when loading image\" + image());\n\t\t}\n\n\t}\n\n\t/**\n\t * {@link UpdateListener} used to capture the details of an error in a response\n\t * stream.\n\t */\n\tprivate static final class ErrorCaptureUpdateListener implements UpdateListener<PushImageUpdateEvent> {\n\n\t\t@Override\n\t\tpublic void onUpdate(PushImageUpdateEvent event) {\n\t\t\tErrorDetail errorDetail = event.getErrorDetail();\n\t\t\tif (errorDetail != null) {\n\t\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\t\"Error response received when pushing image: \" + errorDetail.getMessage());\n\t\t\t}\n\t\t}\n\n\t}\n\n\tenum Feature {\n\n\t\tBASELINE(ApiVersion.of(1, 24)),\n\n\t\tPLATFORM_IMAGE_PULL(ApiVersion.of(1, 41)),\n\n\t\tPLATFORM_CONTAINER_CREATE(ApiVersion.of(1, 41)),\n\n\t\tPLATFORM_IMAGE_INSPECT(ApiVersion.of(1, 49)),\n\n\t\tPLATFORM_IMAGE_EXPORT(ApiVersion.of(1, 48));\n","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java#L613-L649","documentation":"ErrorCaptureUpdateListener watches the streaming JSON response from POST /images/{name}/push. If the daemon emits an event with a non-null errorDetail, the push failed and the listener throws IllegalStateException carrying the daemon's error message verbatim.","triggerScenarios":"Push to a registry that rejected the manifest or a layer: authentication failure, authorization denied, quota exceeded, tag policy violation, mid-push network error.","commonSituations":"Missing or expired registry credentials; image name not matching the registry namespace the user can push to; registry storage quota exceeded; flaky network dropping the connection mid-push.","solutions":["Re-authenticate with the registry (docker login <registry>) and rerun the build","Verify the image tag/namespace and that the user has push permission","Inspect the Docker daemon logs for the full errorDetail, then retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Verify push permission and credentials before pushing\ntry { docker.auth().registryAuthFor(registry); }\ncatch (Exception e) { /* credentials missing -- fix before push */ }","typeGuard":null,"tryCatchPattern":"try { docker.push(image); } catch (IllegalStateException ex) { log.error(\"Registry rejected push: {}\", ex.getMessage()); /* re-auth then retry once */ }","preventionTips":["Run docker login <registry> before invoking the buildpack","Verify the image tag/namespace matches the user's push permission","Inspect daemon logs for the full errorDetail when a push fails"],"tags":["docker","registry","networking","buildpack"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}