{"record":{"id":"2c2e3b48f18bfc99","repo":"alibaba/canal","slug":"canal-adminpasswd-is-empty-pls-check-https-git","errorCode":null,"errorMessage":"canal.adminPasswd is empty , pls check https://github.com/alibaba/canal/issues/4941","messagePattern":"canal\\.adminPasswd is empty , pls check https://github\\.com/alibaba/canal/issues/4941","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"critical","filePath":"admin/admin-web/src/main/java/com/alibaba/otter/canal/admin/config/WebConfig.java","lineNumber":45,"sourceCode":" */\n@Configuration\npublic class WebConfig implements WebMvcConfigurer {\n\n    @Value(value = \"${canal.adminUser}\")\n    private String user;\n\n    @Value(value = \"${canal.adminPasswd}\")\n    private String passwd;\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        if (StringUtils.isEmpty(user)) {\n            throw new IllegalArgumentException(\n                \"canal.adminUser is empty , pls check https://github.com/alibaba/canal/issues/4941\");\n        }\n\n        if (StringUtils.isEmpty(passwd)) {\n            throw new IllegalArgumentException(\n                \"canal.adminPasswd is empty , pls check https://github.com/alibaba/canal/issues/4941\");\n        }\n\n        registry.addInterceptor(new HandlerInterceptor() {\n\n            @Override\n            public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,\n                                     Object o) throws Exception {\n                httpServletResponse.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n                httpServletResponse.setHeader(\"Access-Control-Allow-Methods\", \"*\");\n                httpServletResponse.setHeader(\"Access-Control-Allow-Headers\",\n                    \"Origin, X-Requested-With, Content-Type, Accept, Authorization, X-Token\");\n                httpServletResponse.setHeader(\"Access-Control-Allow-Credentials\", \"true\");\n                httpServletResponse.setHeader(\"Access-Control-Max-Age\", String.valueOf(3600 * 24));\n\n                if (HttpMethod.OPTIONS.toString().equals(httpServletRequest.getMethod())) {\n                    httpServletResponse.setStatus(HttpStatus.NO_CONTENT.value());\n                    return false;","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/admin/admin-web/src/main/java/com/alibaba/otter/canal/admin/config/WebConfig.java#L27-L63","documentation":"Thrown at startup when `canal.adminPasswd` is empty. WebConfig.addInterceptors() guards both credentials; an empty password aborts interceptor registration, blocking application boot.","triggerScenarios":"Boot the admin web app with `canal.adminPasswd` unset/empty. The @Value(\"${canal.adminPasswd}\") field is empty, so the second StringUtils.isEmpty check throws IllegalArgumentException.","commonSituations":"Password property omitted from config; only adminUser set; placeholder not substituted in templated config; secret-management injection (Vault/K8s secret) failed silently leaving blank.","solutions":["Set `canal.adminPasswd` in application.yml or via -Dcanal.adminPasswd=....","Ensure the value is the same admin password configured in the canal-server side (they must match).","If using external secret injection, verify the secret mounted/loaded before the Spring context initializes.","Refer to GitHub issue #4941 for the full credential-pair setup."],"exampleFix":"// before\ncanal:\n  adminUser: admin\n  adminPasswd: \"\"\n\n// after\ncanal:\n  adminUser: admin\n  adminPasswd: your-password","handlingStrategy":"validation","validationCode":"if (org.apache.commons.lang.StringUtils.isBlank(System.getProperty(\"canal.adminPasswd\"))) {\n    throw new IllegalStateException(\"canal.adminPasswd must be set before startup\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Inject adminPasswd from a secrets manager so it is never blank at boot.","Fail fast in CI by starting the app with a dry-run profile that validates required props.","Keep adminUser and adminPasswd configured together to satisfy both guards."],"tags":["config","spring-boot","startup","canal-admin","credentials"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}