{"record":{"id":"883810c73a0b6d09","repo":"spring-projects/spring-boot","slug":"s-exited-with-code-d-s","errorCode":null,"errorMessage":"%s' exited with code %d: %s","messagePattern":"(.+?)' exited with code (.+?): (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/CredentialHelper.java","lineNumber":71,"sourceCode":"\tCredentialHelper(String executable) {\n\t\tthis.executable = executable;\n\t}\n\n\t@Nullable Credential get(String serverUrl) throws IOException {\n\t\tProcessBuilder processBuilder = processBuilder(\"get\");\n\t\tProcess process = start(processBuilder);\n\t\ttry (OutputStream request = process.getOutputStream()) {\n\t\t\trequest.write(serverUrl.getBytes(StandardCharsets.UTF_8));\n\t\t}\n\t\ttry {\n\t\t\tint exitCode = process.waitFor();\n\t\t\ttry (InputStream response = process.getInputStream()) {\n\t\t\t\tif (exitCode == 0) {\n\t\t\t\t\treturn new Credential(SharedJsonMapper.get().readTree(response));\n\t\t\t\t}\n\t\t\t\tString errorMessage = new String(response.readAllBytes(), StandardCharsets.UTF_8);\n\t\t\t\tif (!isCredentialsNotFoundError(errorMessage)) {\n\t\t\t\t\tthrow new IOException(\"%s' exited with code %d: %s\".formatted(process, exitCode, errorMessage));\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\tcatch (InterruptedException ex) {\n\t\t\tThread.currentThread().interrupt();\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tprivate ProcessBuilder processBuilder(String action) {\n\t\tProcessBuilder processBuilder = new ProcessBuilder().redirectErrorStream(true);\n\t\tif (Platform.isWindows()) {\n\t\t\tprocessBuilder.command(\"cmd\", \"/c\");\n\t\t}\n\t\tprocessBuilder.command().addAll(Arrays.asList(this.executable, action));\n\t\treturn processBuilder;\n\t}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/CredentialHelper.java#L53-L89","documentation":"CredentialHelper.get invokes an external credential helper binary (e.g. docker-credential-*), writes the server URL to its stdin, and reads the response. If the helper exits non-zero with a message that is NOT the credentials-not-found sentinel, the plugin throws IOException carrying the process identity, exit code, and stderr. Credentials-not-found is intentionally NOT an error and returns null.","triggerScenarios":"The configured credential helper exists and ran but errored: auth failure, malformed helper config, helper crash, expired token.","commonSituations":"Misconfigured docker-credential-ecr-login for AWS ECR; expired OAuth tokens; helper pointing at a missing keychain; corrupt ~/.docker/config.json with a credsStore entry pointing to a broken helper.","solutions":["Inspect the captured stderr and exit code in the exception message","Run the helper directly to reproduce: echo $SERVER_URL | docker-credential-XXX get","Re-authenticate / refresh tokens, or remove the broken credsStore entry from ~/.docker/config.json"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the helper exists and is executable before invoking\nPath helper = Path.of(\"/usr/local/bin/docker-credential-\" + name);\nif (!Files.isExecutable(helper)) { throw new IllegalStateException(\"credential helper missing: \" + helper); }","typeGuard":null,"tryCatchPattern":"try { CredentialHelper.get(...); } catch (IOException ex) { log.error(\"Credential helper failed: {}\", ex.getMessage()); /* prompt re-auth or fall back */ }","preventionTips":["Run echo $SERVER_URL | docker-credential-XXX get directly to reproduce","Keep ~/.docker/config.json credsStore entry pointing at an installed helper","Refresh registry tokens (ECR, GCR) before they expire"],"tags":["docker","credentials","buildpack","external-process"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}