Kafka Error UNKNOWN_LEADER_EPOCH
Error code 75 · Retriable Broker
The leader epoch in the request is newer than the epoch on the broker.
Common Causes
- Client has newer metadata than the broker — typically during a rolling upgrade where the client connected to an upgraded broker and then retries against a not-yet-upgraded broker
- Follower received a fetch or produce request with a leader epoch that it has not yet observed in its own log
- Clock skew or metadata propagation delay causing a newly elected leader's epoch to not yet be known to all brokers
Solutions
- This is retriable — the client will back off and retry; the broker will catch up on leader epoch propagation
- During rolling upgrades, ensure each broker is fully caught up (`UnderReplicatedPartitions=0`) before restarting the next one to minimize epoch propagation lag
- If persistent, check for networking issues preventing brokers from receiving controller metadata updates promptly
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 -20Related APIs
This error can be returned by: Fetch · OffsetForLeaderEpoch
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.