conduktor.io ↗

Kafka Exception UnknownLeaderEpochException

org.apache.kafka.common.errors.UnknownLeaderEpochException
Retriable Broker

The request contained a leader epoch which is larger than that on the broker that received the request. This can happen if the client observes a metadata update before it has been propagated to all brokers. Clients need not refresh metadata before retrying.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.common.errors.UnknownLeaderEpochException: The leader epoch in the request is newer than the epoch on the broker.

Diagnostic Commands

# Check for under-replicated partitions kafka-topics.sh --bootstrap-server localhost:9092 --describe | grep -c 'UnderReplicated' # Look for related errors in broker logs grep 'UnknownLeaderEpoch\|UNKNOWN_LEADER_EPOCH' /path/to/kafka/logs/server.log | tail -20

Related

Protocol error: UNKNOWN_LEADER_EPOCH (code 75)

Related Broker exceptions: CorruptRecordException · FencedLeaderEpochException · LeaderNotAvailableException · NetworkException · NotEnoughReplicasAfterAppendException · NotEnoughReplicasException · NotLeaderOrFollowerException · TimeoutException

Hitting UnknownLeaderEpochException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.