{"record":{"id":"33a82b8c7dd12e2a","repo":"spring-projects/spring-boot","slug":"initializr-service-call-failed-using-servic","errorCode":null,"errorMessage":"Initializr service call failed using '{}' - service returned {}","messagePattern":"Initializr service call failed using '(.+?)' - service returned (.+?)","errorType":"exception","errorClass":"ReportableException","httpStatus":null,"severity":"error","filePath":"cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrService.java","lineNumber":209,"sourceCode":"\t\tcatch (IOException ex) {\n\t\t\tthrow new ReportableException(\n\t\t\t\t\t\"Failed to \" + description + \" from service at '\" + url + \"' (\" + ex.getMessage() + \")\");\n\t\t}\n\t}\n\n\tprivate ReportableException createException(String url, ClassicHttpResponse httpResponse) {\n\t\tStatusLine statusLine = new StatusLine(httpResponse);\n\t\tString message = \"Initializr service call failed using '\" + url + \"' - service returned \"\n\t\t\t\t+ statusLine.getReasonPhrase();\n\t\tString error = extractMessage(httpResponse.getEntity());\n\t\tif (StringUtils.hasText(error)) {\n\t\t\tmessage += \": '\" + error + \"'\";\n\t\t}\n\t\telse {\n\t\t\tint statusCode = statusLine.getStatusCode();\n\t\t\tmessage += \" (unexpected \" + statusCode + \" error)\";\n\t\t}\n\t\tthrow new ReportableException(message);\n\t}\n\n\tprivate @Nullable String extractMessage(@Nullable HttpEntity entity) {\n\t\tif (entity != null) {\n\t\t\ttry {\n\t\t\t\tJSONObject error = getContentAsJson(entity);\n\t\t\t\tif (error.has(\"message\")) {\n\t\t\t\t\treturn error.getString(\"message\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception ex) {\n\t\t\t\t// Ignore\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate JSONObject getContentAsJson(HttpEntity entity) throws IOException, JSONException {","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/spring-projects/spring-boot/blob/270dfe353fb830fd69b823a8a859287ff103854b/cli/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/init/InitializrService.java#L191-L227","documentation":"Thrown by InitializrService.createException when the HTTP response status code is not 200. The message includes the URL, the status reason phrase, and if the body is JSON with a 'message' field, the server's error text; otherwise it reports the unexpected numeric status code.","triggerScenarios":"Server returns 4xx (bad request, e.g. an unsupported bootVersion/javaVersion combination) or 5xx (server error). Also rate limiting (429).","commonSituations":"Requesting a project type, Java version, or Spring Boot version the server does not support; the Initializr service is misconfigured or failing; being rate-limited.","solutions":["Run 'spring init --list' to see supported capabilities","Adjust bootVersion, javaVersion, and type to values the server supports","If 5xx, retry later or contact the service operator","If 429, back off and retry after a delay"],"exampleFix":"// before\n$ spring init --bootVersion 1.0.0.RELEASE\n// after\n$ spring init --bootVersion 3.2.0  # a version the server supports","handlingStrategy":"try-catch","validationCode":"// Validate parameters against server capabilities first.\nInitializrServiceMetadata md = service.loadMetadata(serviceUrl);\nif (!md.getProjectTypes().containsKey(request.getType())) {\n    throw new IllegalArgumentException(\"Unsupported type; run --list\");\n}\n// This prevents the most common 4xx from reaching createException().","typeGuard":null,"tryCatchPattern":"try {\n    service.generateProject(request);\n} catch (ReportableException ex) {\n    String m = ex.getMessage();\n    if (m.startsWith(\"Initializr service call failed\")) {\n        Log.error(\"Server rejected the request: \" + m + \" - check --list for supported values\");\n    }\n    throw ex;\n}","preventionTips":["Always run 'spring init --list' to discover supported versions/types","Avoid hard-coding bootVersion/javaVersion that may age out","Handle 429 with backoff in automation"],"tags":["network","http-status","initializr","server-response","spring-boot-cli"],"backgroundTag":null,"analyzedSha":"270dfe353fb830fd69b823a8a859287ff103854b","analyzedAt":"2026-08-11T19:42:06.541Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}