{"record":{"id":"85e48a4e7ec6a038","repo":"alibaba/canal","slug":"requestget-remote-error-url-code-error-ms-85e48a","errorCode":null,"errorMessage":"requestGet remote error, url={}, code={}, error msg={}","messagePattern":"requestGet remote error, url=(.+?), code=(.+?), error msg=(.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/HttpHelper.java","lineNumber":70,"sourceCode":"        RequestConfig config = custom().setConnectTimeout(timeout)\n            .setConnectionRequestTimeout(timeout)\n            .setSocketTimeout(timeout)\n            .build();\n        HttpGet httpGet = new HttpGet(uri);\n        HttpClientContext context = HttpClientContext.create();\n        context.setRequestConfig(config);\n        try (CloseableHttpResponse response = httpclient.execute(httpGet, context)) {\n            int statusCode = response.getStatusLine().getStatusCode();\n            long end = System.currentTimeMillis();\n            long cost = end - start;\n            if (logger.isWarnEnabled()) {\n                logger.warn(\"post \" + url + \", cost : \" + cost);\n            }\n            if (statusCode == HttpStatus.SC_OK) {\n                return EntityUtils.toByteArray(response.getEntity());\n            } else {\n                String errorMsg = EntityUtils.toString(response.getEntity());\n                throw new RuntimeException(\"requestGet remote error, url=\" + uri.toString() + \", code=\" + statusCode\n                        + \", error msg=\" + errorMsg);\n            }\n        } finally {\n            httpGet.releaseConnection();\n        }\n    }\n\n    public static String get(String url, int timeout) {\n        // logger.info(\"get url is :\" + url);\n        // 支持采用https协议，忽略证书\n        url = url.trim();\n        if (url.startsWith(\"https\")) {\n            return getIgnoreCerf(url, null, null, timeout);\n        }\n        long start = System.currentTimeMillis();\n        HttpClientBuilder builder = HttpClientBuilder.create();\n        builder.setMaxConnPerRoute(50);\n        builder.setMaxConnTotal(100);","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/HttpHelper.java#L52-L88","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check the status code and error msg in the exception: 401/403 = fix AccessKey, 400 = fix API parameters, 429 = reduce request rate.","Verify the AccessKey ID and Secret in canal instance properties are correct and active in the Alibaba Cloud console.","Confirm the RDS instance ID and region match a real instance.","For 429 throttling: add delay between API calls or batch requests.","Test the API call directly with curl/Postman using the same URL and credentials."],"exampleFix":"# before — wrong access key or region\ncanal.instance.rds.accesskey=LTAI4FakeKeyxxxxx\ncanal.instance.rds.secretkey=FakeSecretxxxxx\ncanal.instance.rds.url=https://rds.aliyuncs.com\n\n# after — valid keys and correct regional endpoint\ncanal.instance.rds.accesskey=LTAI4ValidKeyxxxxx\ncanal.instance.rds.secretkey=ValidSecretxxxxx\ncanal.instance.rds.url=https://rds.cn-hangzhou.aliyuncs.com","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"int maxRetries = 3;\nfor (int attempt = 0; attempt < maxRetries; attempt++) {\n    try {\n        byte[] result = HttpHelper.getBytes(url, timeout);\n        break;\n    } catch (RuntimeException e) {\n        if (e.getMessage().contains(\"requestGet remote error\")) {\n            int code = extractStatusCode(e.getMessage());\n            if (code == 429 && attempt < maxRetries - 1) {\n                Thread.sleep((long) Math.pow(2, attempt) * 2000); // backoff for throttling\n                continue;\n            } else if (code == 401 || code == 403) {\n                throw new ConfigurationException(\"RDS AccessKey invalid or expired\", e);\n            }\n        }\n        throw e;\n    }\n}","preventionTips":["Verify Alibaba Cloud AccessKey/SecretKey are valid and not expired before deployment.","Confirm the RDS instance ID and regional API endpoint match the actual instance.","Add rate-limiting between RDS API calls to avoid 429 throttling."],"tags":["rds","alibaba-cloud","http","api","authentication"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}