{"record":{"id":"f5b13e6e637611c5","repo":"alibaba/canal","slug":"requestget-remote-error-request-f5b13e","errorCode":null,"errorMessage":"requestGet remote error, request : {}","messagePattern":"requestGet remote error, request : (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/HttpHelper.java","lineNumber":114,"sourceCode":"                .setSocketTimeout(timeout)\n                .build();\n            httpGet = new HttpGet(uri);\n            HttpClientContext context = HttpClientContext.create();\n            context.setRequestConfig(config);\n            response = httpclient.execute(httpGet, context);\n            int statusCode = response.getStatusLine().getStatusCode();\n            if (statusCode == HttpStatus.SC_OK) {\n                return EntityUtils.toString(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        } catch (Throwable t) {\n            long end = System.currentTimeMillis();\n            long cost = end - start;\n            String curlRequest = getCurlRequest(url, null, null, cost);\n            throw new RuntimeException(\"requestGet remote error, request : \" + curlRequest, t);\n        } finally {\n            long end = System.currentTimeMillis();\n            long cost = end - start;\n            printCurlRequest(url, null, null, cost);\n            if (response != null) {\n                try {\n                    response.close();\n                } catch (IOException e) {\n                }\n            }\n            httpGet.releaseConnection();\n        }\n    }\n\n    private static String getIgnoreCerf(String url, CookieStore cookieStore, Map<String, String> params, int timeout) {\n        long start = System.currentTimeMillis();\n        HttpClientBuilder builder = HttpClientBuilder.create();\n        builder.setMaxConnPerRoute(50);","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/HttpHelper.java#L96-L132","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Examine the 'cause' exception (the second parameter t) to determine the actual failure — the wrapper message only shows the curl request.","If cause is ConnectException/SocketTimeoutException, increase the timeout parameter passed to HttpHelper.get().","If cause is UnknownHostException, verify the RDS URL hostname and DNS resolution from the canal server.","If the cause is the inner non-200 RuntimeException (error 420), follow the solutions for error 420."],"exampleFix":"// before\ntry {\n    String result = HttpHelper.get(url, 5000);\n} catch (RuntimeException e) {\n    logger.error(e.getMessage());\n}\n\n// after\ntry {\n    String result = HttpHelper.get(url, 5000);\n} catch (RuntimeException e) {\n    Throwable root = e.getCause() != null ? e.getCause() : e;\n    logger.error(\"RDS GET failed: \" + root.getClass().getSimpleName() + \": \" + root.getMessage());\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    String result = HttpHelper.get(url, timeout);\n} catch (RuntimeException e) {\n    Throwable cause = e.getCause() != null ? e.getCause() : e;\n    if (cause instanceof java.net.SocketTimeoutException || cause instanceof java.net.ConnectException) {\n        // retry with backoff\n    } else {\n        throw e;\n    }\n}","preventionTips":["Ensure DNS resolution works for the RDS endpoint from the canal host.","Set a sufficiently large timeout (connect + socket + connection-request).","Verify network/firewall rules allow outbound connections to the RDS API."],"tags":["http","rds","network","error-wrapping","canal-parse"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}