{"record":{"id":"8fc54c08c7ef8487","repo":"apache/dolphinscheduler","slug":"get-request-execute-failed-url-s","errorCode":null,"errorMessage":"Get request execute failed, url: %s","messagePattern":"Get request execute failed, url: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OkHttpUtils.java","lineNumber":65,"sourceCode":"     * @param readTimeout read timeout in milliseconds\n     * @return OkHttpResponse\n     * @throws RuntimeException\n     */\n    public static @NonNull OkHttpResponse get(@NonNull String url,\n                                              @Nullable OkHttpRequestHeaders okHttpRequestHeaders,\n                                              @Nullable Map<String, Object> requestParams,\n                                              int connectTimeout,\n                                              int writeTimeout,\n                                              int readTimeout) throws IOException {\n        OkHttpClient client = getHttpClient(connectTimeout, writeTimeout, readTimeout);\n        String finalUrl = addUrlParams(requestParams, url);\n        Request.Builder requestBuilder = new Request.Builder().url(finalUrl);\n        addHeader(okHttpRequestHeaders.getHeaders(), requestBuilder);\n        Request request = requestBuilder.build();\n        try (Response response = client.newCall(request).execute()) {\n            return new OkHttpResponse(response.code(), getResponseBody(response));\n        } catch (Exception e) {\n            throw new RuntimeException(String.format(\"Get request execute failed, url: %s\", url), e);\n        }\n    }\n\n    /**\n     * http post request\n     * @param connectTimeout connect timeout in milliseconds\n     * @param writeTimeout write timeout in milliseconds\n     * @param readTimeout read timeout in milliseconds\n     * @return OkHttpResponse\n     * @throws RuntimeException\n     */\n    public static @NonNull OkHttpResponse post(@NonNull String url,\n                                               @Nullable OkHttpRequestHeaders okHttpRequestHeaders,\n                                               @Nullable Map<String, Object> requestParamsMap,\n                                               @Nullable Map<String, Object> requestBodyMap,\n                                               int connectTimeout,\n                                               int writeTimeout,\n                                               int readTimeout) throws IOException {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OkHttpUtils.java#L47-L83","documentation":"OkHttpUtils.get executes an OkHttp HTTP GET call and, if execute() or reading the body throws for any reason (connection failure, timeout, DNS error, IO error), it wraps the exception in a RuntimeException formatted with the request URL. The original exception is preserved as the cause.","triggerScenarios":"Calling OkHttpUtils.get(url) when the target host is unreachable, DNS fails, the connection times out, TLS handshake fails, or the response body cannot be read.","commonSituations":"Wrong URL/port in configuration; service down; firewall blocking egress; missing network in the worker/container; misconfigured proxy; timeouts too short for slow upstreams.","solutions":["Check the cause exception to distinguish connect refused vs timeout vs DNS failure","Verify the URL is reachable from the machine running the code (curl the URL)","Increase the OkHttp client connect/read timeouts or add retry logic for transient failures"],"exampleFix":"// before\nString body = OkHttpUtils.get(\"http://internal-host:8080/api\").getBody();\n// after\nOkHttpResponse resp = OkHttpUtils.get(\"http://verified-host:8080/api\"); // URL checked with curl first; wrap in retry for transient errors","handlingStrategy":"retry","validationCode":"if (!url.startsWith(\"http\")) throw new IllegalArgumentException(\"Invalid URL: \" + url);\n// optionally pre-check reachability: InetAddress.getByName(host).isReachable(3000)","typeGuard":null,"tryCatchPattern":"try { return OkHttpUtils.get(url); } catch (RuntimeException e) { if (isTransient(e.getCause())) return retryGet(url, 3); throw e; }","preventionTips":["Validate URLs in config at startup (host resolves, port open)","Set explicit OkHttp connect/read timeouts","Use retries with backoff for idempotent GETs","Monitor upstream service health"],"tags":["http","okhttp","get","network"],"backgroundTag":"http-request-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}