apache/dolphinscheduler · error · RuntimeException

Get request execute failed, url: %s

Error message

Get request execute failed, url: %s

What it means

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.

Source

Thrown at dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/OkHttpUtils.java:65

     * @param readTimeout read timeout in milliseconds
     * @return OkHttpResponse
     * @throws RuntimeException
     */
    public static @NonNull OkHttpResponse get(@NonNull String url,
                                              @Nullable OkHttpRequestHeaders okHttpRequestHeaders,
                                              @Nullable Map<String, Object> requestParams,
                                              int connectTimeout,
                                              int writeTimeout,
                                              int readTimeout) throws IOException {
        OkHttpClient client = getHttpClient(connectTimeout, writeTimeout, readTimeout);
        String finalUrl = addUrlParams(requestParams, url);
        Request.Builder requestBuilder = new Request.Builder().url(finalUrl);
        addHeader(okHttpRequestHeaders.getHeaders(), requestBuilder);
        Request request = requestBuilder.build();
        try (Response response = client.newCall(request).execute()) {
            return new OkHttpResponse(response.code(), getResponseBody(response));
        } catch (Exception e) {
            throw new RuntimeException(String.format("Get request execute failed, url: %s", url), e);
        }
    }

    /**
     * http post request
     * @param connectTimeout connect timeout in milliseconds
     * @param writeTimeout write timeout in milliseconds
     * @param readTimeout read timeout in milliseconds
     * @return OkHttpResponse
     * @throws RuntimeException
     */
    public static @NonNull OkHttpResponse post(@NonNull String url,
                                               @Nullable OkHttpRequestHeaders okHttpRequestHeaders,
                                               @Nullable Map<String, Object> requestParamsMap,
                                               @Nullable Map<String, Object> requestBodyMap,
                                               int connectTimeout,
                                               int writeTimeout,
                                               int readTimeout) throws IOException {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check the cause exception to distinguish connect refused vs timeout vs DNS failure
  2. Verify the URL is reachable from the machine running the code (curl the URL)
  3. Increase the OkHttp client connect/read timeouts or add retry logic for transient failures

Example fix

// before
String body = OkHttpUtils.get("http://internal-host:8080/api").getBody();
// after
OkHttpResponse resp = OkHttpUtils.get("http://verified-host:8080/api"); // URL checked with curl first; wrap in retry for transient errors
Defensive patterns

Strategy: retry

Validate before calling

if (!url.startsWith("http")) throw new IllegalArgumentException("Invalid URL: " + url);
// optionally pre-check reachability: InetAddress.getByName(host).isReachable(3000)

Try / catch

try { return OkHttpUtils.get(url); } catch (RuntimeException e) { if (isTransient(e.getCause())) return retryGet(url, 3); throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: Wrong URL/port in configuration; service down; firewall blocking egress; missing network in the worker/container; misconfigured proxy; timeouts too short for slow upstreams.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/8fc54c08c7ef8487. Report an issue: GitHub.