{"record":{"id":"29130239819f3aa7","repo":"alibaba/canal","slug":"error-config-filename-errormessage-291302","errorCode":null,"errorMessage":"ERROR Config: {fileName} {errorMessage}","messagePattern":"ERROR Config: (.+?) (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"client-adapter/tablestore/src/main/java/com/alibaba/otter/canal/client/adapter/tablestore/config/ConfigLoader.java","lineNumber":42,"sourceCode":"     * 加载RDB表映射配置\n     *\n     * @return 配置名/配置文件名--对象\n     */\n    public static Map<String, MappingConfig> load(Properties envProperties) {\n        logger.info(\"## Start loading tablestore mapping config ... \");\n\n        Map<String, MappingConfig> result = new LinkedHashMap<>();\n\n        Map<String, String> configContentMap = MappingConfigsLoader.loadConfigs(\"tablestore\");\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 Config: \" + fileName + \" \" + e.getMessage(), e);\n            }\n            result.put(fileName, config);\n        });\n\n        logger.info(\n            \"## Tablestore mapping config loaded:\" + StringUtils.collectionToCommaDelimitedString(result.keySet()));\n        return result;\n    }\n}\n","sourceCodeStart":24,"sourceCodeEnd":52,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/tablestore/src/main/java/com/alibaba/otter/canal/client/adapter/tablestore/config/ConfigLoader.java#L24-L52","documentation":"Thrown by ConfigLoader.load() during tablestore mapping config parsing when config.validate() throws for any individual YAML file. The error wraps the original validation exception's message and includes the config file name so you can identify which file failed. This is a fail-fast guard: if any single config file is invalid, the entire load aborts.","triggerScenarios":"Loading tablestore configs where one YAML file fails MappingConfig.validate() — typically because dbMapping.database, dbMapping.table, or dbMapping.targetTable is null or empty. Also possible if the YAML is malformed in a way that YamlUtils.ymlToObj parses but leaves required fields unset.","commonSituations":"A YAML file is missing the dbMapping section entirely; dbMapping exists but database/table/targetTable sub-keys are blank; YAML indentation errors cause dbMapping fields to be parsed as top-level; an incomplete or templated config file was deployed.","solutions":["Read the errorMessage in the exception — it identifies which specific field (e.g. 'dbMapping.database') is null or empty.","Open the named fileName and verify the dbMapping block has non-empty database, table, and targetTable values.","Validate YAML syntax and indentation — misaligned YAML can cause nested fields to be silently skipped.","Remove or fix incomplete config files before deploying to avoid blocking all tablestore configs."],"exampleFix":"// before: incomplete dbMapping in YAML\ndestination: example\ndbMapping:\n  database: mydb\n  # table and targetTable missing\n\n// after\ndestination: example\ndbMapping:\n  database: mydb\n  table: source_table\n  targetTable: ots_target_table","handlingStrategy":"validation","validationCode":"// Validate the config before passing it to ConfigLoader\nMappingConfig config = YamlUtils.ymlToObj(null, content, MappingConfig.class, null, envProperties);\nif (config != null) {\n    try {\n        config.validate();\n    } catch (NullPointerException e) {\n        throw new IllegalArgumentException(\"Config file \" + fileName + \" is invalid: \" + e.getMessage(), e);\n    }\n}","typeGuard":"null","tryCatchPattern":"try {\n    Map<String, MappingConfig> configs = ConfigLoader.load(envProperties);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"ERROR Config:\")) {\n        logger.error(\"Invalid tablestore mapping config file: {}\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Run a YAML linting + schema validation step in CI before deploying mapping configs.","Use a config template with required fields marked as mandatory.","Test config files against validate() in a staging environment before production deploy."],"tags":["tablestore-adapter","config-validation","yaml","config-error"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}