apache/dolphinscheduler · error · RuntimeException

Delete request execute failed, url: %s

Error message

Delete request execute failed, url: %s

What it means

OkHttpUtils.delete() wraps any failure while executing an OkHttp DELETE call into a RuntimeException including the URL, with the underlying exception as cause. This is a transport-level failure: the request did not complete (connection, timeout, IO, or response-read error), not an HTTP error status.

Source

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

     * @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 delete(@NonNull String url,
                                                 @Nullable OkHttpRequestHeaders okHttpRequestHeaders,
                                                 int connectTimeout,
                                                 int writeTimeout,
                                                 int readTimeout) throws IOException {
        OkHttpClient client = getHttpClient(connectTimeout, writeTimeout, readTimeout);
        Request.Builder requestBuilder = new Request.Builder().url(url);
        addHeader(okHttpRequestHeaders.getHeaders(), requestBuilder);
        requestBuilder = requestBuilder.delete();
        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            return new OkHttpResponse(response.code(), getResponseBody(response));
        } catch (Exception e) {
            throw new RuntimeException(String.format("Delete request execute failed, url: %s", url), e);
        }
    }

    private static String addUrlParams(@Nullable Map<String, Object> requestParams, @NonNull String url) {
        if (requestParams == null) {
            return url;
        }

        HttpUrl httpUrl = HttpUrl.parse(url);
        if (httpUrl == null) {
            throw new IllegalArgumentException(String.format("url: %s is invalid", url));
        }
        HttpUrl.Builder urlBuilder = httpUrl.newBuilder();
        for (Map.Entry<String, Object> entry : requestParams.entrySet()) {
            urlBuilder.addQueryParameter(entry.getKey(), entry.getValue().toString());
        }
        return urlBuilder.toString();
    }

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Test the DELETE endpoint directly with curl from the same machine.
  2. Inspect the cause exception to identify connect vs read vs TLS failure.
  3. Raise the connectTimeout passed to delete(...) if the server is slow to respond.
  4. Fix DNS/service address or restart the target service.

Example fix

// before
OkHttpUtils.delete(url, headers, timeout);
// after
try {
    OkHttpResponse resp = OkHttpUtils.delete(url, headers, timeout);
} catch (RuntimeException e) {
    log.warn("DELETE {} failed: {}", url, e.getCause());
}
Defensive patterns

Strategy: try-catch

Validate before calling

HttpUrl parsed = HttpUrl.parse(url);
if (parsed == null) throw new IllegalArgumentException("Bad DELETE url: " + url);

Try / catch

try {
    OkHttpResponse r = OkHttpUtils.delete(url, headers, timeout);
} catch (RuntimeException e) {
    log.warn("DELETE {} failed: {}", url, e.getCause());
}

Prevention

When it happens

Trigger: Calling OkHttpUtils.delete(...) when the endpoint is unreachable, the connection is reset, connect/read timeouts fire, or reading the response throws, inside client.newCall(requestBuilder.build()).execute().

Common situations: Deleting a resource on a service that has gone down mid-session; wrong host/port in URL; proxy intercepting DELETE; long-running delete exceeding timeouts; stale DNS in container environments.

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/20b8bad0e1456608. Report an issue: GitHub.