kafka
config_error
ai_generated
true
Connect异常:工作器配置必须恰好设置'key.converter'或'value.converter'之一,但发现0个
org.apache.kafka.connect.errors.ConnectException: Worker config must have exactly one of 'key.converter' or 'value.converter' set, but found 0
ID: kafka/connect-worker-config-mismatch
95%修复率
89%置信度
1证据数
2024-06-01首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Kafka 3.6.0 | active | — | — | — |
| Kafka 3.7.0 | active | — | — | — |
| Kafka Connect 3.6.0 | active | — | — | — |
根因分析
Kafka Connect工作器缺少键或值序列化所需的转换器配置,导致启动失败。
English
Kafka Connect worker is missing required converter configuration for key or value serialization, causing startup failure.
官方文档
https://kafka.apache.org/documentation/#connect_configuring解决方案
-
Add `key.converter=org.apache.kafka.connect.json.JsonConverter` and `value.converter=org.apache.kafka.connect.json.JsonConverter` in worker.properties, then restart the worker.
-
Example fix in worker.properties: `key.converter=org.apache.kafka.connect.storage.StringConverter` and `value.converter=org.apache.kafka.connect.json.JsonConverter` for mixed formats.
-
Check environment variable overrides: `echo $CONNECT_KEY_CONVERTER` and ensure they are not conflicting.
无效尝试
常见但无效的做法:
-
70% 失败
The error says exactly one must be set; setting both does not fix the missing configuration.
-
80% 失败
Defaults are not guaranteed and may not match the connector's data format.