Kafka Error STALE_MEMBER_EPOCH
Error code 113 · Non-retriable Consumer
The member epoch is stale. The member must retry after receiving its updated member epoch via the ConsumerGroupHeartbeat API.
Common Causes
- The consumer sent a request (fetch, commit offset, etc.) using a member epoch that is behind the current epoch tracked by the group coordinator — the coordinator has since advanced the epoch but the client hasn't picked up the update yet.
- Race condition during rebalance: the consumer received an epoch update in a heartbeat response but a concurrent in-flight request (e.g., OffsetCommit) was still carrying the old epoch.
- Slow consumer or high coordinator load causing delayed heartbeat responses, during which the consumer's epoch goes stale.
Solutions
- The consumer should obtain the latest member epoch from the coordinator and retry with that value; Kafka client libraries that support the consumer protocol do this automatically after the next ConsumerGroupHeartbeat response.
- If stale epochs are frequent under the consumer protocol, tune broker-side group.consumer.heartbeat.interval.ms and group.consumer.session.timeout.ms so members receive epoch updates quickly enough during rebalances.
- Ensure the Kafka client library version supports the new consumer protocol properly (3.7+). Older clients may not correctly handle epoch synchronization across concurrent API calls.
Diagnostic Commands
# Describe consumer group offsets and lag
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group <group-id>
# Look for heartbeat/session events in logs
grep 'STALE_MEMBER_EPOCH\|stale epoch\|ConsumerGroupHeartbeat' /var/log/kafka/server.log | tail -50Related APIs
This error can be returned by: ConsumerGroupHeartbeat · OffsetCommit
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.