alibaba/canal · error · RuntimeException

requestGet remote error, url={}, code={}, error msg={}

Error message

requestGet remote error, url={}, code={}, error msg={}

What it means

Thrown as RuntimeException from HttpHelper.getBytes() when the HTTP GET to an RDS API endpoint returns a non-200 status code. Unlike error 418 (which downloads binlog file content), this is for RDS OpenAPI metadata calls (e.g. DescribeBinlogFiles, DescribeDBInstanceAttributes). The exception includes the URL, HTTP status code, and the error response body from the server.

Source

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

        RequestConfig config = custom().setConnectTimeout(timeout)
            .setConnectionRequestTimeout(timeout)
            .setSocketTimeout(timeout)
            .build();
        HttpGet httpGet = new HttpGet(uri);
        HttpClientContext context = HttpClientContext.create();
        context.setRequestConfig(config);
        try (CloseableHttpResponse response = httpclient.execute(httpGet, context)) {
            int statusCode = response.getStatusLine().getStatusCode();
            long end = System.currentTimeMillis();
            long cost = end - start;
            if (logger.isWarnEnabled()) {
                logger.warn("post " + url + ", cost : " + cost);
            }
            if (statusCode == HttpStatus.SC_OK) {
                return EntityUtils.toByteArray(response.getEntity());
            } else {
                String errorMsg = EntityUtils.toString(response.getEntity());
                throw new RuntimeException("requestGet remote error, url=" + uri.toString() + ", code=" + statusCode
                        + ", error msg=" + errorMsg);
            }
        } finally {
            httpGet.releaseConnection();
        }
    }

    public static String get(String url, int timeout) {
        // logger.info("get url is :" + url);
        // 支持采用https协议,忽略证书
        url = url.trim();
        if (url.startsWith("https")) {
            return getIgnoreCerf(url, null, null, timeout);
        }
        long start = System.currentTimeMillis();
        HttpClientBuilder builder = HttpClientBuilder.create();
        builder.setMaxConnPerRoute(50);
        builder.setMaxConnTotal(100);

View on GitHub (pinned to 87be50e876)

Solutions

  1. Check the status code and error msg in the exception: 401/403 = fix AccessKey, 400 = fix API parameters, 429 = reduce request rate.
  2. Verify the AccessKey ID and Secret in canal instance properties are correct and active in the Alibaba Cloud console.
  3. Confirm the RDS instance ID and region match a real instance.
  4. For 429 throttling: add delay between API calls or batch requests.
  5. Test the API call directly with curl/Postman using the same URL and credentials.

Example fix

# before — wrong access key or region
canal.instance.rds.accesskey=LTAI4FakeKeyxxxxx
canal.instance.rds.secretkey=FakeSecretxxxxx
canal.instance.rds.url=https://rds.aliyuncs.com

# after — valid keys and correct regional endpoint
canal.instance.rds.accesskey=LTAI4ValidKeyxxxxx
canal.instance.rds.secretkey=ValidSecretxxxxx
canal.instance.rds.url=https://rds.cn-hangzhou.aliyuncs.com
Defensive patterns

Strategy: retry

Try / catch

int maxRetries = 3;
for (int attempt = 0; attempt < maxRetries; attempt++) {
    try {
        byte[] result = HttpHelper.getBytes(url, timeout);
        break;
    } catch (RuntimeException e) {
        if (e.getMessage().contains("requestGet remote error")) {
            int code = extractStatusCode(e.getMessage());
            if (code == 429 && attempt < maxRetries - 1) {
                Thread.sleep((long) Math.pow(2, attempt) * 2000); // backoff for throttling
                continue;
            } else if (code == 401 || code == 403) {
                throw new ConfigurationException("RDS AccessKey invalid or expired", e);
            }
        }
        throw e;
    }
}

Prevention

When it happens

Trigger: httpclient.execute(httpGet) returns a non-OK status. Only 200 returns the byte array; any other code throws. Common: 400 (bad request — invalid API parameters), 401/403 (invalid/expired AccessKey), 404 (wrong API endpoint or instance not found), 429 (API throttling), 500 (RDS internal error).

Common situations: The Alibaba Cloud AccessKey/SecretKey are wrong or expired. The RDS instance ID doesn't exist in the specified region. API rate limiting triggered (DescribeBinlogFiles has QPS limits). The RDS OpenAPI endpoint URL is wrong (wrong region prefix). Network issues reaching the Alibaba Cloud API.

Related errors


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