alibaba/canal · error · RuntimeException

ERROR load Config: {} {}

Error message

ERROR load Config: {} {}

What it means

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).

Source

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

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

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

        Map<String, String> configContentMap = MappingConfigsLoader.loadConfigs("hbase");
        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 load Config: " + fileName + " " + e.getMessage(), e);
            }
            result.put(fileName, config);
        });

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

View on GitHub (pinned to 87be50e876)

Solutions

  1. Read the full chained exception to find the inner validate() message (one of errors 146-150), which names the offending field.
  2. Open the named fileName and fix the indicated field.
  3. Re-deploy / restart the adapter to re-run config load.
  4. Validate the YAML locally with MappingConfig.validate() before deploying.

Example fix

// before: stack trace shows 'ERROR load Config: my.yml hbaseMapping.database'
# fix the file my.yml:
hbaseMapping:
  database: mydb   # was missing
  table: t_user
  hbaseTable: user
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-validate each config file before the loader aggregates them
Map<String,String> contents = MappingConfigsLoader.loadConfigs("hbase");
contents.forEach((name, body) -> {
    MappingConfig c = YamlUtils.ymlToObj(null, body, MappingConfig.class, null, envProperties);
    if (c != null) {
        try { c.validate(); }
        catch (Exception ex) { logger.error(name + " invalid: " + ex.getMessage()); }
    }
});

Try / catch

try {
    Map<String, MappingConfig> all = MappingConfigLoader.load(envProperties);
} catch (RuntimeException e) {
    // e.getMessage() is 'ERROR load Config: <file> <inner field>'
    // e.getCause() carries the validate() NullPointerException/RuntimeException
    logger.error("Config load failed: " + e.getMessage(), e.getCause());
    throw e;
}

Prevention

When it happens

Trigger: Adapter startup while loading any HBase mapping YAML whose validate() fails (missing database/table/hbaseTable/mode, or conflicting rowKey config).

Common situations: Deploying a new or edited mapping YAML with a validation error; the outer message names the file, the inner message names the field.

Related errors


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