Kafka Error FENCED_LEADER_EPOCH
Error code 74 · Retriable Broker
The leader epoch in the request is older than the epoch on the broker.
Common Causes
- A follower or stale leader is still sending requests using an old leader epoch after a new leader election has occurred
- Consumer or producer cached stale metadata and is writing/reading from a broker that is no longer the leader for that partition
- Split-brain during controller failover: old controller still issuing LeaderAndIsr requests with a lower epoch than the new controller
Solutions
- This is retriable — the client will refresh metadata and retry against the new leader automatically; no manual action needed in most cases
- Force a metadata refresh on the client side if the error persists: restart the consumer or producer, or wait for the next metadata refresh cycle; `producer.flush()` does not refresh metadata
- Investigate controller logs for repeated rapid leader elections — may indicate broker instability, GC pauses, or network partitions
Diagnostic Commands
# Look for epoch fencing events in logs
grep 'FencedLeaderEpoch\|leader.epoch\|LeaderAndIsr' /path/to/kafka/logs/controller.log | tail -30
# Describe topic replicas and ISR status
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic <topic> | grep -E 'Leader|Isr|Replicas'Related APIs
This error can be returned by: Fetch
Related KIPs
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.