{"record":{"id":"16ea0eb0a1be3ff6","repo":"spring-projects/spring-boot","slug":"no-content-received-from-server","errorCode":null,"errorMessage":"No content received from server '{}'","messagePattern":"No content received from server '(.+?)'","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":146,"sourceCode":"\t\tContentType contentType = ContentType.create(httpEntity.getContentType());\n\t\tif (contentType.getMimeType().equals(\"text/plain\")) {\n\t\t\treturn getContent(httpEntity);\n\t\t}\n\t\treturn parseJsonMetadata(httpEntity);\n\t}\n\n\tprivate InitializrServiceMetadata parseJsonMetadata(HttpEntity httpEntity) throws IOException {\n\t\ttry {\n\t\t\treturn new InitializrServiceMetadata(getContentAsJson(httpEntity));\n\t\t}\n\t\tcatch (JSONException ex) {\n\t\t\tthrow new ReportableException(\"Invalid content received from server (\" + ex.getMessage() + \")\", ex);\n\t\t}\n\t}\n\n\tprivate void validateResponse(ClassicHttpResponse httpResponse, String serviceUrl) {\n\t\tif (httpResponse.getEntity() == null) {\n\t\t\tthrow new ReportableException(\"No content received from server '\" + serviceUrl + \"'\");\n\t\t}\n\t\tif (httpResponse.getCode() != 200) {\n\t\t\tthrow createException(serviceUrl, httpResponse);\n\t\t}\n\t}\n\n\tprivate ProjectGenerationResponse createResponse(ClassicHttpResponse httpResponse, HttpEntity httpEntity)\n\t\t\tthrows IOException {\n\t\tProjectGenerationResponse response = new ProjectGenerationResponse(\n\t\t\t\tContentType.create(httpEntity.getContentType()));\n\t\tresponse.setContent(FileCopyUtils.copyToByteArray(httpEntity.getContent()));\n\t\tString fileName = extractFileName(httpResponse.getFirstHeader(\"Content-Disposition\"));\n\t\tif (fileName != null) {\n\t\t\tresponse.setFileName(fileName);\n\t\t}\n\t\treturn response;\n\t}\n","sourceCodeStart":128,"sourceCodeEnd":164,"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#L128-L164","documentation":"Thrown by InitializrService.validateResponse when httpResponse.getEntity() is null. The check runs before the status-code check, so any response with no body (even a 200) triggers it. The message names the service URL so the failing endpoint is identifiable.","triggerScenarios":"The Initializr endpoint returns a response with a null entity (empty body), e.g. a server misconfiguration returning an empty 200, or an intermediary that drops the body.","commonSituations":"Server under load returning truncated responses; a reverse proxy misconfigured to strip the body; the wrong endpoint path returning an empty response.","solutions":["Confirm the --target URL endpoint path is correct","Test the endpoint with curl to verify it returns a body","Verify no proxy is stripping response bodies","Retry; may be transient under heavy server load"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-flight with curl/plain HTTP client: assert the response has a non-empty body.\n// GET <serviceUrl>  -> expect Content-Length > 0 and a parseable body.","typeGuard":null,"tryCatchPattern":"try {\n    service.generateProject(request);\n} catch (ReportableException ex) {\n    if (ex.getMessage().startsWith(\"No content received from server\")) {\n        Log.error(\"Endpoint returned an empty body; check the URL/proxy: \" + serviceUrl);\n    }\n    throw ex;\n}","preventionTips":["Verify the endpoint returns a body with curl before automating","Suspect proxies that strip bodies on error","Retry once - empty bodies can be transient under load"],"tags":["network","initializr","server-response","empty-body","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"}