alibaba/canal · error · RuntimeException

ERROR Config: {fileName} {errorMessage}

Error message

ERROR Config: {fileName} {errorMessage}

What it means

Thrown by the rdb ConfigLoader.load() as a wrapper around any exception from config.validate() for a given rdb mapping file. It embeds the fileName and the underlying cause message and chains the original exception.

Source

Thrown at client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/config/ConfigLoader.java:42

     * 加载RDB表映射配置
     *
     * @return 配置名/配置文件名--对象
     */
    public static Map<String, MappingConfig> load(Properties envProperties) {
        logger.info("## Start loading rdb mapping config ... ");

        Map<String, MappingConfig> result = new LinkedHashMap<>();

        Map<String, String> configContentMap = MappingConfigsLoader.loadConfigs("rdb");
        configContentMap.forEach((fileName, content) -> {
            MappingConfig config = YamlUtils.ymlToObj(null, content, MappingConfig.class, null, envProperties);
            if (config == null) {
                return;
            }
            try {
                config.validate();
            } catch (Exception e) {
                throw new RuntimeException("ERROR Config: " + fileName + " " + e.getMessage(), e);
            }
            result.put(fileName, config);
        });

        logger.info("## Rdb mapping config loaded");
        return result;
    }
}

View on GitHub (pinned to 87be50e876)

Solutions

  1. Use the fileName and chained cause in the stack trace to find the missing field.
  2. Open that yml and supply the field (note table/targetTable are skipped only when mirrorDb is true).
  3. Restart the adapter.

Example fix

# Error: ERROR Config: rdb/bad.yml dbMapping.table
# before
dbMapping:
  database: mytest
# after
dbMapping:
  database: mytest
  table: user
Defensive patterns

Strategy: try-catch

Try / catch

try {
    Map<String, MappingConfig> all = ConfigLoader.load(envProperties);
} catch (RuntimeException e) {
    String file = e.getMessage().replaceAll("^ERROR Config: (\\S+).*", "$1");
    logger.error("Rdb mapping file failed validation: {}", file, e.getCause());
    throw e;
}

Prevention

When it happens

Trigger: For a loaded rdb yml, MappingConfig.validate() throws (e.g. NullPointerException for missing database/table/targetTable); the loader rethrows with 'ERROR Config: <fileName> <cause>'.

Common situations: An rdb yml is missing a required field; the fileName in the message identifies the file.

Related errors


AI-assisted analysis of alibaba/canal@87be50e876 (2026-08-14). Data as JSON: /api/errors/5392855fa90fb5cc. Report an issue: GitHub.