{"record":{"id":"570b91ae6970c750","repo":"alibaba/canal","slug":"http-request-failed-result","errorCode":null,"errorMessage":"http request failed! {result}","messagePattern":"http request failed! (.+?)","errorType":"http","errorClass":"RuntimeException","httpStatus":null,"severity":"warning","filePath":"parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/request/AbstractRequest.java","lineNumber":239,"sourceCode":"            throw new RuntimeException(\"return error !\" + response.getStatusLine().getReasonPhrase() + \", \" + result);\n        }\n        return response;\n    }\n\n    protected abstract T processResult(HttpResponse response) throws Exception;\n\n    protected void processBefore() {\n\n    }\n\n    public final T doAction() throws Exception {\n        processBefore();\n        String requestStr = makeRequestString(treeMap);\n        HttpGet httpGet = new HttpGet(protocol + \"://\" + endPoint + \"?\" + requestStr);\n        HttpResponse response = executeHttpRequest(httpGet, endPoint);\n        if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {\n            String result = EntityUtils.toString(response.getEntity());\n            throw new RuntimeException(\"http request failed! \" + result);\n        }\n        return processResult(response);\n    }\n}\n","sourceCodeStart":221,"sourceCodeEnd":244,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/rds/request/AbstractRequest.java#L221-L244","documentation":"Thrown by AbstractRequest.doAction() after executeHttpRequest() returns a response whose status code is not 200 OK. This is a secondary check — it fires when executeHttpRequest allowed a response through (e.g., status 206 Partial Content) but doAction requires strictly 200.","triggerScenarios":"executeHttpRequest passes the initial check (status 200 or 206), but doAction's subsequent check rejects any non-200 status. This means a 206 Partial Content response would pass executeHttpRequest but be rejected here. The response body is read and included in the error.","commonSituations":"Server returns 206 Partial Content for range requests which executeHttpRequest allows but doAction rejects; edge case where the response status changes between the two checks (unlikely); the API returns a redirect (3xx) that was not followed.","solutions":["Check the response body in the error message for the server-side explanation.","If status is 206, this may be a legitimate response that the code should handle — consider overriding doAction or processResult to accept 206.","Verify the request parameters are correct for the specific RDS API action being called.","If the status is a redirect, ensure the httpClient follows redirects or the URL is the final destination."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    T result = request.doAction();\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"http request failed!\")) {\n    // inspect the result body for the specific error\n    }\n}","preventionTips":["Ensure the RDS API endpoint returns 200 for valid requests.","Verify all query parameters and signature are correct.","Check for HTTP redirects that the client may not follow."],"tags":["rds","openapi","http","status-check","canal-parse"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}