alibaba/canal · critical · RuntimeException

No phoenix adapter found for config key: {}

Error message

No phoenix adapter found for config key: {}

What it means

Thrown by PhoenixAdapter.init() after loading and key-filtering all phoenix mapping yml files. If none match this adapter's key, phoenixMapping is empty and the adapter aborts startup. The thrown key is configuration.getKey() declared under canalAdapters in application.yml.

Source

Thrown at client-adapter/phoenix/src/main/java/com/alibaba/otter/canal/client/adapter/phoenix/PhoenixAdapter.java:75

        logger.info("PhoenixAdapter create: {} {}", this, Thread.currentThread().getStackTrace());
    }
    /**
     * 初始化方法
     *
     * @param configuration 外部适配器配置信息
     */
    @Override
    public void init(OuterAdapterConfig configuration, Properties envProperties) {
        this.envProperties = envProperties;
        this.configuration = configuration;
        Map<String, MappingConfig> phoenixMappingTmp = ConfigLoader.load(envProperties);
        // 过滤不匹配的key的配置
        phoenixMappingTmp.forEach((key, config) -> {
            addConfig(key, config);
        });

        if (phoenixMapping.isEmpty()) {
            throw new RuntimeException("No phoenix adapter found for config key: " + configuration.getKey());
        } else {
            logger.info("[{}]phoenix config mapping: {}", this, phoenixMapping.keySet());
        }

        Map<String, String> properties = configuration.getProperties();

        DriverClass= properties.get("jdbc.driverClassName");
        PhoenixUrl=properties.get("jdbc.url");

        try {
            //phoenix内部本身有连接池,不需要使用Druid初始化
            phoenixPro.setProperty("hbase.rpc.timeout","600000");
            phoenixPro.setProperty("hbase.client.scanner.timeout.period","600000");
            phoenixPro.setProperty("dfs.client.socket-timeout","600000");
            phoenixPro.setProperty("phoenix.query.keepAliveMs","600000");
            phoenixPro.setProperty("phoenix.query.timeoutMs","3600000");
            Class.forName(DriverClass);
        } catch (ClassNotFoundException e) {

View on GitHub (pinned to 87be50e876)

Solutions

  1. Set 'outerAdapterKey:' in every phoenix/*.yml to exactly the 'key:' declared for the phoenix adapter in application.yml.
  2. Confirm phoenix mapping yml files are in the correct config directory and are valid YAML.
  3. Check logs for the phoenix config mapping keyset and for any null-parse skips.

Example fix

# application.yml
  - name: phoenix
    key: phoenix
# phoenix/my_table.yml
outerAdapterKey: phoenix
Defensive patterns

Strategy: validation

Validate before calling

String adapterKey = configuration.getKey();
boolean anyMatch = ConfigLoader.load(envProperties).values().stream()
    .anyMatch(c -> c.getOuterAdapterKey() != null
        && c.getOuterAdapterKey().equalsIgnoreCase(adapterKey));
if (!anyMatch) {
    throw new IllegalStateException(
        "No phoenix mapping yml has outerAdapterKey=" + adapterKey);
}

Prevention

When it happens

Trigger: PhoenixAdapter.init() runs; every MappingConfig fails match() (outerAdapterKey non-null and != configuration.getKey(), or null with non-matching auto-generated prefix), or ConfigLoader.load() returned an empty map.

Common situations: The 'outerAdapterKey:' in a phoenix/*.yml does not equal the 'key:' of the phoenix adapter in application.yml. Phoenix mapping files are missing or unreadable so nothing loads.

Related errors


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