kafka protocol_error ai_generated true

org.apache.kafka.common.errors.UnsupportedVersionException: The broker does not support the required API version

ID: kafka/unsupported-version-broker-api

Also available as: JSON · Markdown · 中文
90%Fix Rate
85%Confidence
1Evidence
2023-04-15First Seen

Root Cause

Kafka client requests an API version that the broker does not support, often due to mismatched client-broker versions.

generic

中文

Kafka客户端请求了代理不支持的API版本,通常是由于客户端与代理版本不匹配。

Official Documentation

https://kafka.apache.org/documentation/#upgrade

Workarounds

  1. 90% success Update the Kafka client library to match the broker version. For example, if broker is 3.4.0, use kafka-clients 3.4.0 in your project.
    Update the Kafka client library to match the broker version. For example, if broker is 3.4.0, use kafka-clients 3.4.0 in your project.
  2. 85% success Set inter.broker.protocol.version in broker config to match the older version if client cannot be upgraded immediately.
    Set inter.broker.protocol.version in broker config to match the older version if client cannot be upgraded immediately.

中文步骤

  1. Update the Kafka client library to match the broker version. For example, if broker is 3.4.0, use kafka-clients 3.4.0 in your project.
  2. Set inter.broker.protocol.version in broker config to match the older version if client cannot be upgraded immediately.

Dead Ends

Common approaches that don't work:

  1. 70% fail

    Upgrading only the client without checking broker version compatibility

  2. 60% fail

    Manually setting api.version.request=false in client config, which can cause silent failures