{"record":{"id":"cd13a3aeba25c656","repo":"alibaba/canal","slug":"requestpost-https-remote-error-request-sta","errorCode":null,"errorMessage":"requestPost(Https) remote error, request : {}, statusCode={}","messagePattern":"requestPost\\(Https\\) remote error, request : (.+?), statusCode=(.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/HttpHelper.java","lineNumber":239,"sourceCode":"                parameters.add(nameValuePair);\n            }\n            httpPost.setEntity(new UrlEncodedFormEntity(parameters, Charset.forName(\"UTF-8\")));\n            HttpClientContext context = HttpClientContext.create();\n            context.setRequestConfig(config);\n            context.setCookieStore(cookieStore);\n\n            response = httpClient.execute(httpPost, context);\n            int statusCode = response.getStatusLine().getStatusCode();\n            if (statusCode == HttpStatus.SC_OK) {\n                long end = System.currentTimeMillis();\n                long cost = end - start;\n                printCurlRequest(url, cookieStore, params, cost);\n                return EntityUtils.toString(response.getEntity());\n            } else {\n                long end = System.currentTimeMillis();\n                long cost = end - start;\n                String curlRequest = getCurlRequest(url, cookieStore, params, cost);\n                throw new RuntimeException(\"requestPost(Https) remote error, request : \" + curlRequest\n                                           + \", statusCode=\" + statusCode + \"\");\n            }\n        } catch (Throwable t) {\n            long end = System.currentTimeMillis();\n            long cost = end - start;\n            String curlRequest = getCurlRequest(url, cookieStore, params, cost);\n            throw new RuntimeException(\"requestPost(Https) remote error, request : \" + curlRequest, t);\n        } finally {\n            if (response != null) {\n                try {\n                    response.close();\n                } catch (IOException e) {\n                }\n            }\n            if (httpPost != null) {\n                httpPost.releaseConnection();\n            }\n        }","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/HttpHelper.java#L221-L257","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Verify the CookieStore has valid, non-expired cookies if authentication is cookie-based.","Check that all required POST parameters are present in the params map.","If statusCode is 5xx or 429, retry with exponential backoff."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    String result = HttpHelper.post(httpsUrl, cookieStore, params, timeout);\n} catch (RuntimeException e) {\n    // The statusCode is in the message but response body is NOT included.\n    // Reproduce with curl (from logs) to see the response body.\n    String curlCmd = extractCurlFromMessage(e.getMessage());\n}","preventionTips":["Log the curl-equivalent request string at WARN level for debugging (the code does this via printCurlRequest).","Ensure cookies are refreshed if using session-based auth.","Validate all required POST parameters are in the params map."],"tags":["https","rds","network","post","api-error"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}