alibaba/canal · error · RuntimeException

requestPost(Https) remote error, request

Error message

requestPost(Https) remote error, request : {}, statusCode={}

What it means

Thrown by postIgnoreCerf() (HTTPS POST with certificate bypass) when the remote server returns a non-200 status code. The message includes the curl-equivalent request, the statusCode, but NOT the response body (unlike error 426 which includes it). This is the inner throw inside the try block.

Solutions

  1. Since the response body is NOT in the message, enable debug/warn logging to capture printCurlRequest output and manually reproduce with curl to see the response body.
  2. Verify the CookieStore has valid, non-expired cookies if authentication is cookie-based.
  3. Check that all required POST parameters are present in the params map.
  4. If statusCode is 5xx or 429, retry with exponential backoff.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    String result = HttpHelper.post(httpsUrl, cookieStore, params, timeout);
} catch (RuntimeException e) {
    // The statusCode is in the message but response body is NOT included.
    // Reproduce with curl (from logs) to see the response body.
    String curlCmd = extractCurlFromMessage(e.getMessage());
}

Prevention

When it happens

Trigger: Calling HttpHelper.post(url, cookieStore, params, timeout) with an https:// URL that gets a non-200 response. The post() method delegates to postIgnoreCerf() for HTTPS URLs. The response body is consumed but not included in the error message — only the status code is reported.

Common situations: RDS login/authentication endpoint returning 401/403 when cookie is expired or invalid; POST parameters are malformed or missing required fields; RDS API rate limiting via 429; server-side errors (5xx) during RDS binlog download request submission.

Related errors


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

Appendix: source

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

                parameters.add(nameValuePair);
            }
            httpPost.setEntity(new UrlEncodedFormEntity(parameters, Charset.forName("UTF-8")));
            HttpClientContext context = HttpClientContext.create();
            context.setRequestConfig(config);
            context.setCookieStore(cookieStore);

            response = httpClient.execute(httpPost, context);
            int statusCode = response.getStatusLine().getStatusCode();
            if (statusCode == HttpStatus.SC_OK) {
                long end = System.currentTimeMillis();
                long cost = end - start;
                printCurlRequest(url, cookieStore, params, cost);
                return EntityUtils.toString(response.getEntity());
            } else {
                long end = System.currentTimeMillis();
                long cost = end - start;
                String curlRequest = getCurlRequest(url, cookieStore, params, cost);
                throw new RuntimeException("requestPost(Https) remote error, request : " + curlRequest
                                           + ", statusCode=" + statusCode + "");
            }
        } catch (Throwable t) {
            long end = System.currentTimeMillis();
            long cost = end - start;
            String curlRequest = getCurlRequest(url, cookieStore, params, cost);
            throw new RuntimeException("requestPost(Https) remote error, request : " + curlRequest, t);
        } finally {
            if (response != null) {
                try {
                    response.close();
                } catch (IOException e) {
                }
            }
            if (httpPost != null) {
                httpPost.releaseConnection();
            }
        }

View on GitHub (pinned to 87be50e876)