{"record":{"id":"7ddf8902fe13877f","repo":"apache/dolphinscheduler","slug":"post-request-execute-failed-url-s","errorCode":null,"errorMessage":"Post request execute failed, url: %s","messagePattern":"Post 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":96,"sourceCode":"                                               @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 {\n        OkHttpClient client = getHttpClient(connectTimeout, writeTimeout, readTimeout);\n        String finalUrl = addUrlParams(requestParamsMap, url);\n        Request.Builder requestBuilder = new Request.Builder().url(finalUrl);\n        addHeader(okHttpRequestHeaders.getHeaders(), requestBuilder);\n        if (requestBodyMap != null) {\n            requestBuilder = requestBuilder.post(RequestBody.create(\n                    JSONUtils.toJsonString(requestBodyMap),\n                    MediaType.parse(okHttpRequestHeaders.getOkHttpRequestHeaderContentType().getValue())));\n        }\n        try (Response response = client.newCall(requestBuilder.build()).execute()) {\n            return new OkHttpResponse(response.code(), getResponseBody(response));\n        } catch (Exception e) {\n            throw new RuntimeException(String.format(\"Post request execute failed, url: %s\", url), e);\n        }\n    }\n\n    /**\n     * http put 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 put(@NonNull String url,\n                                              @Nullable OkHttpRequestHeaders okHttpRequestHeaders,\n                                              @Nullable Map<String, Object> requestBodyMap,\n                                              int connectTimeout,\n                                              int writeTimeout,\n                                              int readTimeout) throws IOException {\n        OkHttpClient client = getHttpClient(connectTimeout, writeTimeout, readTimeout);","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OkHttpUtils.java#L78-L114","documentation":"OkHttpUtils.post executes an OkHttp HTTP POST call and wraps any exception thrown during execute() or body reading into a RuntimeException formatted with the request URL, preserving the original cause. It signals the POST request could not be completed at the transport level (not an HTTP error status, which is returned as-is).","triggerScenarios":"Calling OkHttpUtils.post(url, ...) when the connection fails, times out, DNS resolution fails, TLS fails, or reading the response body throws.","commonSituations":"Target API server down or URL wrong; long-running uploads hitting read timeout; network egress blocked; JSON body serialization succeeding but transport failing due to proxy/firewall.","solutions":["Inspect the wrapped cause to identify connection vs timeout vs DNS problem","Verify the endpoint with curl -X POST and correct payload","Raise connect/read timeouts and add retry/backoff for transient network failures"],"exampleFix":"// before\nOkHttpResponse resp = OkHttpUtils.post(unreachableUrl, headers, body);\n// after\n// pre-check reachability, then retry on transient errors\nOkHttpResponse resp = retryablePost(url, headers, body, /*maxRetries=*/3);","handlingStrategy":"retry","validationCode":"if (!url.startsWith(\"http\")) throw new IllegalArgumentException(\"Invalid URL: \" + url);\n// confirm endpoint accepts POST before production use (contract test)","typeGuard":null,"tryCatchPattern":"try { return OkHttpUtils.post(url, headers, body); } catch (RuntimeException e) { if (isTransient(e.getCause())) return retryPost(url, headers, body, 3); throw e; }","preventionTips":["Validate endpoint reachability and method support before deploying","Configure generous timeouts for large payloads","Only retry when the request is idempotent or the failure is clearly pre-send","Log the URL and cause for postmortems"],"tags":["http","okhttp","post","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-14T05:17:10.506Z"}