{"record":{"id":"8c1ad5d564e2e976","repo":"alibaba/canal","slug":"error-load-config","errorCode":null,"errorMessage":"ERROR load Config: {} {}","messagePattern":"ERROR load Config: (.+?) (.+?)","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/config/MappingConfigLoader.java","lineNumber":42,"sourceCode":"     * 加载HBase表映射配置\n     *\n     * @return 配置名/配置文件名--对象\n     */\n    public static Map<String, MappingConfig> load(Properties envProperties) {\n        logger.info(\"## Start loading hbase mapping config ... \");\n\n        Map<String, MappingConfig> result = new LinkedHashMap<>();\n\n        Map<String, String> configContentMap = MappingConfigsLoader.loadConfigs(\"hbase\");\n        configContentMap.forEach((fileName, content) -> {\n            MappingConfig config = YamlUtils.ymlToObj(null, content, MappingConfig.class, null, envProperties);\n            if (config == null) {\n                return;\n            }\n            try {\n                config.validate();\n            } catch (Exception e) {\n                throw new RuntimeException(\"ERROR load Config: \" + fileName + \" \" + e.getMessage(), e);\n            }\n            result.put(fileName, config);\n        });\n\n        logger.info(\"## Hbase mapping config loaded\");\n        return result;\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":51,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/hbase/src/main/java/com/alibaba/otter/canal/client/adapter/hbase/config/MappingConfigLoader.java#L24-L51","documentation":"MappingConfigLoader.load() wraps any exception thrown by config.validate() into a RuntimeException prefixed with 'ERROR load Config: <fileName> <inner message>'. It is a startup-time config-loading failure whose real cause is in the chained exception (the inner validate() message, e.g. hbaseMapping.database).","triggerScenarios":"Adapter startup while loading any HBase mapping YAML whose validate() fails (missing database/table/hbaseTable/mode, or conflicting rowKey config).","commonSituations":"Deploying a new or edited mapping YAML with a validation error; the outer message names the file, the inner message names the field.","solutions":["Read the full chained exception to find the inner validate() message (one of errors 146-150), which names the offending field.","Open the named fileName and fix the indicated field.","Re-deploy / restart the adapter to re-run config load.","Validate the YAML locally with MappingConfig.validate() before deploying."],"exampleFix":"// before: stack trace shows 'ERROR load Config: my.yml hbaseMapping.database'\n# fix the file my.yml:\nhbaseMapping:\n  database: mydb   # was missing\n  table: t_user\n  hbaseTable: user","handlingStrategy":"try-catch","validationCode":"// Pre-validate each config file before the loader aggregates them\nMap<String,String> contents = MappingConfigsLoader.loadConfigs(\"hbase\");\ncontents.forEach((name, body) -> {\n    MappingConfig c = YamlUtils.ymlToObj(null, body, MappingConfig.class, null, envProperties);\n    if (c != null) {\n        try { c.validate(); }\n        catch (Exception ex) { logger.error(name + \" invalid: \" + ex.getMessage()); }\n    }\n});","typeGuard":null,"tryCatchPattern":"try {\n    Map<String, MappingConfig> all = MappingConfigLoader.load(envProperties);\n} catch (RuntimeException e) {\n    // e.getMessage() is 'ERROR load Config: <file> <inner field>'\n    // e.getCause() carries the validate() NullPointerException/RuntimeException\n    logger.error(\"Config load failed: \" + e.getMessage(), e.getCause());\n    throw e;\n}","preventionTips":["Inspect the full cause chain: the inner message names the field.","Validate each mapping YAML with config.validate() in a build job.","Deploy configs one at a time to isolate failures."],"tags":["hbase-adapter","config","loader","startup"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}