Kafka Error OFFSET_NOT_AVAILABLE
Error code 78 · Retriable Broker
The leader high watermark has not caught up from a recent leader election so the offsets cannot be guaranteed to be monotonically increasing.
Common Causes
- Consumer or offset lookup hit a new leader immediately after leader election, before that leader had established a stable high watermark
- Follower fetching or preferred-read-replica logic asked a replica for an offset that is not yet available on that replica even though it may exist on the leader
- Leader changed while replicas were lagging, so the new leader must first catch up its log state before it can answer the offset query
Solutions
- Treat this as transient and retry; Kafka returns OFFSET_NOT_AVAILABLE while the new leader is still establishing the high watermark
- If it persists, reduce leader churn and replica lag: inspect under-replicated partitions, slow disks, and network saturation on the replicas involved
- If you use follower fetching (client.rack or replica.selector.class), confirm the preferred replica stays close to the leader; otherwise let the consumer fall back to the leader
Diagnostic Commands
# Check for partitions without a leader
kafka-topics.sh --bootstrap-server localhost:9092 --describe | grep -v 'Isr:.*Replicas' | grep 'Leader: -1\|UnderReplicated'
# Check consumer group lag and offsets
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group <groupId> | grep -E 'LAG|CURRENT-OFFSET'Related APIs
This error can be returned by: Fetch · ListOffsets
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.