{"record":{"id":"3148d282ec8d6d42","repo":"alibaba/canal","slug":"no-phoenix-adapter-found-for-config-key","errorCode":null,"errorMessage":"No phoenix adapter found for config key: {}","messagePattern":"No phoenix adapter found for config key: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"client-adapter/phoenix/src/main/java/com/alibaba/otter/canal/client/adapter/phoenix/PhoenixAdapter.java","lineNumber":75,"sourceCode":"        logger.info(\"PhoenixAdapter create: {} {}\", this, Thread.currentThread().getStackTrace());\n    }\n    /**\n     * 初始化方法\n     *\n     * @param configuration 外部适配器配置信息\n     */\n    @Override\n    public void init(OuterAdapterConfig configuration, Properties envProperties) {\n        this.envProperties = envProperties;\n        this.configuration = configuration;\n        Map<String, MappingConfig> phoenixMappingTmp = ConfigLoader.load(envProperties);\n        // 过滤不匹配的key的配置\n        phoenixMappingTmp.forEach((key, config) -> {\n            addConfig(key, config);\n        });\n\n        if (phoenixMapping.isEmpty()) {\n            throw new RuntimeException(\"No phoenix adapter found for config key: \" + configuration.getKey());\n        } else {\n            logger.info(\"[{}]phoenix config mapping: {}\", this, phoenixMapping.keySet());\n        }\n\n        Map<String, String> properties = configuration.getProperties();\n\n        DriverClass= properties.get(\"jdbc.driverClassName\");\n        PhoenixUrl=properties.get(\"jdbc.url\");\n\n        try {\n            //phoenix内部本身有连接池，不需要使用Druid初始化\n            phoenixPro.setProperty(\"hbase.rpc.timeout\",\"600000\");\n            phoenixPro.setProperty(\"hbase.client.scanner.timeout.period\",\"600000\");\n            phoenixPro.setProperty(\"dfs.client.socket-timeout\",\"600000\");\n            phoenixPro.setProperty(\"phoenix.query.keepAliveMs\",\"600000\");\n            phoenixPro.setProperty(\"phoenix.query.timeoutMs\",\"3600000\");\n            Class.forName(DriverClass);\n        } catch (ClassNotFoundException e) {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client-adapter/phoenix/src/main/java/com/alibaba/otter/canal/client/adapter/phoenix/PhoenixAdapter.java#L57-L93","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set 'outerAdapterKey:' in every phoenix/*.yml to exactly the 'key:' declared for the phoenix adapter in application.yml.","Confirm phoenix mapping yml files are in the correct config directory and are valid YAML.","Check logs for the phoenix config mapping keyset and for any null-parse skips."],"exampleFix":"# application.yml\n  - name: phoenix\n    key: phoenix\n# phoenix/my_table.yml\nouterAdapterKey: phoenix","handlingStrategy":"validation","validationCode":"String adapterKey = configuration.getKey();\nboolean anyMatch = ConfigLoader.load(envProperties).values().stream()\n    .anyMatch(c -> c.getOuterAdapterKey() != null\n        && c.getOuterAdapterKey().equalsIgnoreCase(adapterKey));\nif (!anyMatch) {\n    throw new IllegalStateException(\n        \"No phoenix mapping yml has outerAdapterKey=\" + adapterKey);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the phoenix adapter 'key:' and every phoenix yml 'outerAdapterKey:' in sync via a shared config source.","Add a CI check that loads all phoenix yml files and asserts each adapter key has a matching config."],"tags":["phoenix","config","adapter-init","canal","key-mismatch"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}