conductor-oss/conductor · error · RuntimeException

Error making an HTTP call {reasonPhrase}, status: {statusCod

Error message

Error making an HTTP call {reasonPhrase}, status: {statusCode}

What it means

Thrown inside HttpDocumentLoader.httpCall when the OkHttp Response is not successful (!response.isSuccessful()). This is the generic per-call failure for any non-2xx status during a GET/POST/PUT/DELETE/PATCH made through the loader (the download path and the inner upload path both go through httpCall). Message includes reasonPhrase and statusCode. RuntimeException.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/document/HttpDocumentLoader.java:198

        try (Response response = httpClient.newCall(requestBuilder.build()).execute()) {
            HttpResponse httpResponse = new HttpResponse();
            httpResponse.statusCode = response.code();
            httpResponse.reasonPhrase = response.message();

            // Convert OkHttp headers to Spring HttpHeaders for compatibility
            org.springframework.http.HttpHeaders springHeaders =
                    new org.springframework.http.HttpHeaders();
            response.headers().toMultimap().forEach(springHeaders::addAll);
            httpResponse.headers = springHeaders;

            // Read response body
            if (response.body() != null) {
                httpResponse.body = response.body().bytes();
            }

            // Check for errors
            if (!response.isSuccessful()) {
                throw new RuntimeException(
                        "Error making an HTTP call "
                                + httpResponse.reasonPhrase
                                + ", status: "
                                + httpResponse.statusCode);
            }

            return httpResponse;
        }
    }

    /** Create RequestBody from the input body object. */
    private RequestBody createRequestBody(Object body, String contentType) {
        if (body == null) {
            return RequestBody.create(new byte[0], null);
        }

        MediaType mediaType =
                contentType != null

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Read the statusCode/reasonPhrase to classify: 4xx -> fix request (URL/headers/auth), 5xx/429 -> retry after backoff or wait.
  2. Verify the URL and any auth headers are correct for the target service.
  3. For transient 5xx, note the loader only retries ConnectException/SocketException — HTTP-level 5xx is NOT retried, so wrap the call in your own retry for those.
  4. Check the target service health/logs if 5xx persists.
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate the URL is reachable-shaped before the call (does not guarantee success)
java.net.URI u = java.net.URI.create(location);
if (u.getHost() == null) throw new IllegalArgumentException("Invalid URL: " + location);

Try / catch

// The loader only retries ConnectException/SocketException; add your own retry for HTTP 5xx
int attempt = 0;
while (true) {
    try {
        return loader.download(location);
    } catch (RuntimeException e) {
        if (++attempt >= MAX_ATTEMPTS || !isTransient(e)) throw e;
        backoff(attempt);
    }
}

Prevention

When it happens

Trigger: Any HTTP call the loader makes returns a non-2xx status: server errors (5xx), client errors (4xx), redirects not auto-followed, etc. Connection-level failures (ConnectException/SocketException) are handled separately by retryOperation (up to 3 retries) and surface as a different wrapped throwable.

Common situations: Download endpoint returns 404/500; target service is temporarily unhealthy; a required header/query is missing causing 400; rate limiting (429).

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/10f998df448c42af. Report an issue: GitHub.