Kafka Error INVALID_FETCH_SESSION_EPOCH
Error code 71 · Retriable Consumer
The fetch session epoch is invalid.
Common Causes
- Consumer's fetch session epoch is out of sync with the broker — typically after a broker restart or session eviction followed by a stale retry
- Client bug: fetch epoch counter not incremented correctly between requests, or reset to 0 unexpectedly
- Load balancer or proxy injecting delays causing the client to retransmit with an old epoch
Solutions
- This is retriable — consumer client will reset the session epoch and establish a new fetch session automatically
- If the error is persistent, check for proxy/load balancer interference on the Kafka port that might be replaying stale requests
- Upgrade client library if on an older version with known fetch session epoch tracking bugs (check client release notes)
Diagnostic Commands
# Look for fetch session events in logs
grep 'InvalidFetchSessionEpoch\|fetch.session.epoch\|INVALID_FETCH_SESSION_EPOCH' /path/to/kafka/logs/server.log | tail -20
# Show consumer group member assignments
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group <groupId> | grep -E 'LAG|CONSUMER-ID'Related APIs
This error can be returned by: Fetch
Debugging Kafka errors? Conduktor Console gives you real-time visibility into your cluster. Explore all errors in the Error Decoder.