Kafka Error FETCH_SESSION_TOPIC_ID_ERROR
Error code 106 · Retriable Consumer
The fetch session encountered inconsistent topic ID usage.
Common Causes
- An incremental fetch session was established before a topic was deleted and recreated — the session still references the old topic UUID, causing ID mismatch on subsequent incremental fetches
- Broker-side fetch session cache has a stale topic ID entry that does not match the current topic metadata after a topic UUID change
- Consumer is using fetch sessions (introduced in KIP-227) and the session state diverged from the broker after a metadata change
Solutions
- This is retriable — the client should close the fetch session (send a full fetch request with session ID=0) and re-establish a fresh session with current topic IDs
- Ensure the consumer's metadata is refreshed after topic deletion/recreation events — set metadata.max.age.ms to a lower value in volatile environments
- If the error recurs, check for broker bugs related to fetch session management and upgrade to a patch version that addresses FETCH_SESSION topic ID handling
Diagnostic Commands
# Check topic UUID and metadata
kafka-topics.sh --bootstrap-server localhost:9092 --describe --topic <topic-name> | grep TopicId
# Look for fetch session events in logs
grep 'FetchSessionTopicIdError\|fetch session\|topic.*id.*mismatch' /var/log/kafka/server.log | tail -20Related 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.