{"record":{"id":"a07c2d71e2e175d3","repo":"spring-projects/spring-boot","slug":"failed-to-from-service-at","errorCode":null,"errorMessage":"Failed to {} from service at '{}' ({})","messagePattern":"Failed to (.+?) from service at '(.+?)' \\((.+?)\\)","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":192,"sourceCode":"\t/**\n\t * Retrieves the meta-data of the service at the specified URL.\n\t * @param url the URL\n\t * @return the response\n\t */\n\tprivate ClassicHttpResponse executeInitializrMetadataRetrieval(String url) {\n\t\tHttpGet request = new HttpGet(url);\n\t\trequest.setHeader(new BasicHeader(HttpHeaders.ACCEPT, ACCEPT_META_DATA));\n\t\treturn execute(request, URI.create(url), \"retrieve metadata\");\n\t}\n\n\tprivate ClassicHttpResponse execute(HttpUriRequest request, URI url, String description) {\n\t\ttry {\n\t\t\tHttpHost host = HttpHost.create(url);\n\t\t\trequest.addHeader(\"User-Agent\", \"SpringBootCli/\" + getClass().getPackage().getImplementationVersion());\n\t\t\treturn getHttp().executeOpen(host, request, null);\n\t\t}\n\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}","sourceCodeStart":174,"sourceCodeEnd":210,"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#L174-L210","documentation":"Thrown by InitializrService.execute when the HTTP client raises an IOException contacting the service. The description string identifies the operation (e.g. 'retrieve metadata' or 'generate project'). This wraps low-level transport failures into a user-reportable ReportableException that includes the URL and the IOException message.","triggerScenarios":"DNS resolution failure for the service host; connection refused; socket/read timeout; TLS handshake failure; network unreachable; proxy rejection.","commonSituations":"Offline or behind a restrictive corporate firewall; typo in the host name; the Initializr service is down; slow network causing read timeouts; missing proxy configuration.","solutions":["Confirm network connectivity and DNS resolution for the host","Check the --target URL host spelling","Retry the command (transient failures)","Configure JVM proxy settings (-Dhttp.proxyHost / -Dhttps.proxyHost) if behind a proxy","Increase client timeouts if the service is legitimately slow"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Before the call, sanity-check reachability.\njava.net.InetAddress.getByName(hostFromUrl(serviceUrl)); // surfaces DNS errors early\n// Configure timeouts and proxy on the HttpClient used by InitializrService\n// so transient slowness does not immediately throw.","typeGuard":null,"tryCatchPattern":"int maxAttempts = 3;\nfor (int attempt = 1; attempt <= maxAttempts; attempt++) {\n    try {\n        return service.generateProject(request);\n    } catch (ReportableException ex) {\n        if (ex.getMessage().startsWith(\"Failed to \") && attempt < maxAttempts) {\n            Thread.sleep(500L * attempt); // exponential-ish backoff\n            continue;\n        }\n        throw ex;\n    }\n}","preventionTips":["Configure JVM proxy settings in proxy environments","Set explicit connect/read timeouts on the HTTP client","Validate the host resolves before automating"],"tags":["network","io","initializr","timeout","connection","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"}