{"record":{"id":"93a7568cc17604b9","repo":"alibaba/canal","slug":"requestget-for-canal-config-error","errorCode":null,"errorMessage":"requestGet for canal config error: {}","messagePattern":"requestGet for canal config error: (.+?)","errorType":"http","errorClass":"CanalException","httpStatus":null,"severity":"error","filePath":"instance/manager/src/main/java/com/alibaba/otter/canal/instance/manager/plain/PlainCanalConfigClient.java","lineNumber":128,"sourceCode":"        try {\n            ResponseModel<CanalConfig> config = doQuery(url);\n            return processData(config.data);\n        } catch (Throwable e) {\n            throw new CanalException(\"load manager config failed.\", e);\n        }\n    }\n\n    private ResponseModel<CanalConfig> doQuery(String url) {\n        Map<String, String> heads = new HashMap<>();\n        heads.put(\"user\", user);\n        heads.put(\"passwd\", passwd);\n        String response = httpHelper.get(url, heads, REQUEST_TIMEOUT);\n        ResponseModel<CanalConfig> resp = JSON.parseObject(response,\n            new TypeReference<ResponseModel<CanalConfig>>() {\n            });\n\n        if (!HttpHelper.REST_STATE_OK.equals(resp.code)) {\n            throw new CanalException(\"requestGet for canal config error: \" + resp.message);\n        }\n\n        return resp;\n    }\n\n    private PlainCanal processData(CanalConfig config) throws IOException, NoSuchAlgorithmException {\n        Properties properties = new Properties();\n        String md5 = null;\n        String status = null;\n        if (config != null && StringUtils.isNotEmpty(config.content)) {\n            md5 = SecurityUtil.md5String(config.content);\n            status = config.status;\n            properties.load(new ByteArrayInputStream(config.content.getBytes(StandardCharsets.UTF_8)));\n        } else {\n            // null代表没有新配置变更\n            return null;\n        }\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/instance/manager/src/main/java/com/alibaba/otter/canal/instance/manager/plain/PlainCanalConfigClient.java#L110-L146","documentation":"Thrown inside PlainCanalConfigClient.doQuery when the Admin server responds with valid JSON but a non-OK code (code != HttpHelper.REST_STATE_OK). It means the Admin API explicitly rejected the config request and returned an error message, which is surfaced verbatim in resp.message. This is an application-level rejection, distinct from a transport-level failure (which would bubble up as error 360).","triggerScenarios":"doQuery(url) succeeds in fetching and parsing the response, but ResponseModel.code is not equal to REST_STATE_OK. Happens on findServer/findInstance/findInstances when the Admin server returns an error envelope, e.g. authentication failure, unknown destination, or internal Admin error.","commonSituations":"Wrong user/passwd in canal.manager.* (Admin returns an auth-failed code), requesting an instance_polling for a destination that does not exist in Admin, or the Admin server has an internal error (DB down) and returns code 500-equivalent with a message.","solutions":["Read resp.message from the exception text (it is appended after 'requestGet for canal config error: ') to get the Admin's stated reason.","If it indicates auth, fix canal.manager.user / canal.manager.password to match an Admin account.","If it indicates unknown instance, register the destination in Canal Admin or correct the destination name.","Confirm Canal Admin and Canal Server are the same release so the code/value contract for REST_STATE_OK matches."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify credentials/destination against admin before relying on config\n// (canal admin has no public pre-check; validate by performing the request and inspecting code)\nResponseModel<?> r = doQueryOnce(url); // your wrapper\nif (!HttpHelper.REST_STATE_OK.equals(r.code)) {\n    throw new IllegalStateException(\"admin rejected config: \" + r.message);\n}","typeGuard":null,"tryCatchPattern":"try {\n    return configClient.findInstance(destination, md5);\n} catch (CanalException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"requestGet for canal config error:\")) {\n        // application-level rejection; surface admin's message to ops\n        alertOps(e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Keep canal.manager.user/passwd consistent with an Admin account.","Register destinations in Admin before requesting instance config for them.","Treat any non-OK code as actionable Admin feedback, not a transient retry."],"tags":["config","canal-admin","authentication","remote-config"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}