conductor-oss/conductor · error · RuntimeException

Failed to download image from

Error message

Failed to download image from 

What it means

OpenAIVideoModel.downloadFromUrl() catches a non-RuntimeException and wraps it in RuntimeException with message "Failed to download image from " + url. This is the fallback catch for the image-to-video input image download: any checked Exception (IOException from the OkHttp execute()/bytes() call, or other I/O error) is wrapped. RuntimeExceptions (including error 214) are rethrown unchanged.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/providers/openai/OpenAIVideoModel.java:212

        } else if (inputImage.toLowerCase().endsWith(".png")) {
            return "image/png";
        } else if (inputImage.toLowerCase().endsWith(".webp")) {
            return "image/webp";
        }
        return "image/jpeg";
    }

    private byte[] downloadFromUrl(String url) {
        okhttp3.Request request = new okhttp3.Request.Builder().url(url).get().build();
        try (okhttp3.Response response = httpClient.newCall(request).execute()) {
            if (response.body() == null) {
                throw new RuntimeException("Empty response downloading image from " + url);
            }
            return response.body().bytes();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new RuntimeException("Failed to download image from " + url, e);
        }
    }
}

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Verify the URL is reachable from the Conductor worker's network (curl from the worker host).
  2. Check DNS resolution and firewall rules for the image hostname.
  3. Increase the OkHttp read timeout if the image server is slow (configured via AIHttpClients / OpenAIConfiguration timeout).
  4. Convert the image to a data: URI or raw base64 to avoid the network dependency entirely.
  5. Host the image on a reliable CDN or local file server accessible to the worker.

Example fix

// before
req.setInputImage("https://internal-lan-host:8080/image.jpg"); // unreachable from worker
// after — embed the image to avoid network
req.setInputImage("data:image/jpeg;base64," + Base64.getEncoder().encodeToString(imageBytes));
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate input image URL reachability before video job submission
private void validateImageReachable(String url) {
    try {
        URI uri = URI.create(url);
        String host = uri.getHost();
        if (host == null) {
            throw new IllegalArgumentException("Invalid image URL (no host): " + url);
        }
        // Optionally: resolve DNS and do a connectivity check
        java.net.InetAddress.getByName(host); // throws if DNS fails
    } catch (Exception e) {
        throw new IllegalArgumentException(
            "Input image URL is not reachable: " + url, e);
    }
}

Type guard

null

Try / catch

try {
    videoModel.call(prompt);
} catch (RuntimeException e) {
    Throwable cause = e.getCause();
    if (cause != null && cause instanceof Exception) {
        String msg = cause.getMessage() != null ? cause.getMessage() : "";
        if (msg.contains("download image") || msg.contains("Failed to download")) {
            // Network error fetching input image
            throw new IllegalArgumentException(
                "Cannot download input image from URL. " +
                "Verify network access or use a data: URI.", e);
        }
    }
    throw e;
}

Prevention

When it happens

Trigger: VideoGenRequest.inputImage is an HTTP/HTTPS URL. The OkHttp GET request throws an IOException: DNS resolution failure, connection refused, connection timeout, read timeout (slow server), TLS handshake failure, or the server resets the connection.

Common situations: Input image hosted on a server behind a firewall blocking the Conductor worker; DNS not resolving the image hostname; slow image server causing read timeout; TLS certificate issues; the URL host is down; network partition between the Conductor worker and the image CDN.

Related errors


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