alibaba/canal · error · RuntimeException

requestGet remote error, request : {}

Error message

requestGet remote error, request : {}

What it means

Thrown by the catch (Throwable t) block in HttpHelper.get() as an outer wrapper around ANY exception that occurs during the HTTP GET operation (including error 420). The message includes a curl-equivalent request string for debugging. The original exception is preserved as the cause.

Source

Thrown at parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/HttpHelper.java:114

                .setSocketTimeout(timeout)
                .build();
            httpGet = new HttpGet(uri);
            HttpClientContext context = HttpClientContext.create();
            context.setRequestConfig(config);
            response = httpclient.execute(httpGet, context);
            int statusCode = response.getStatusLine().getStatusCode();
            if (statusCode == HttpStatus.SC_OK) {
                return EntityUtils.toString(response.getEntity());
            } else {
                String errorMsg = EntityUtils.toString(response.getEntity());
                throw new RuntimeException("requestGet remote error, url=" + uri.toString() + ", code=" + statusCode
                                           + ", error msg=" + errorMsg);
            }
        } catch (Throwable t) {
            long end = System.currentTimeMillis();
            long cost = end - start;
            String curlRequest = getCurlRequest(url, null, null, cost);
            throw new RuntimeException("requestGet remote error, request : " + curlRequest, t);
        } finally {
            long end = System.currentTimeMillis();
            long cost = end - start;
            printCurlRequest(url, null, null, cost);
            if (response != null) {
                try {
                    response.close();
                } catch (IOException e) {
                }
            }
            httpGet.releaseConnection();
        }
    }

    private static String getIgnoreCerf(String url, CookieStore cookieStore, Map<String, String> params, int timeout) {
        long start = System.currentTimeMillis();
        HttpClientBuilder builder = HttpClientBuilder.create();
        builder.setMaxConnPerRoute(50);

View on GitHub (pinned to 87be50e876)

Solutions

  1. Examine the 'cause' exception (the second parameter t) to determine the actual failure — the wrapper message only shows the curl request.
  2. If cause is ConnectException/SocketTimeoutException, increase the timeout parameter passed to HttpHelper.get().
  3. If cause is UnknownHostException, verify the RDS URL hostname and DNS resolution from the canal server.
  4. If the cause is the inner non-200 RuntimeException (error 420), follow the solutions for error 420.

Example fix

// before
try {
    String result = HttpHelper.get(url, 5000);
} catch (RuntimeException e) {
    logger.error(e.getMessage());
}

// after
try {
    String result = HttpHelper.get(url, 5000);
} catch (RuntimeException e) {
    Throwable root = e.getCause() != null ? e.getCause() : e;
    logger.error("RDS GET failed: " + root.getClass().getSimpleName() + ": " + root.getMessage());
}
Defensive patterns

Strategy: retry

Try / catch

try {
    String result = HttpHelper.get(url, timeout);
} catch (RuntimeException e) {
    Throwable cause = e.getCause() != null ? e.getCause() : e;
    if (cause instanceof java.net.SocketTimeoutException || cause instanceof java.net.ConnectException) {
        // retry with backoff
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Any Throwable during HttpHelper.get(): the inner non-200 status throw (error 420), connection timeout, socket timeout, SSL handshake failure, UnknownHostException, or URISyntaxException. The catch is broad (Throwable) so even NullPointerException or OOM would be wrapped here.

Common situations: RDS endpoint hostname is unreachable (UnknownHostException); connection or socket timeout too low for RDS API latency; network firewall/proxy blocking outbound HTTPS; DNS resolution failure; the RDS OpenAPI is temporarily down.

Related errors


AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14). Data as JSON: /api/errors/f5b13e6e637611c5. Report an issue: GitHub.