Kafka Exception UnknownMemberIdException
org.apache.kafka.common.errors.UnknownMemberIdException
Non-retriable
Consumer
UnknownMemberIdException is a Kafka exception (org.apache.kafka.common.errors.UnknownMemberIdException).
Common Causes
- Consumer session expired (heartbeat timeout) while processing; broker evicted it from the group, but the consumer still holds the old member ID and tries to commit or heartbeat
- Consumer restarted and received a new member ID, but stale application logic is still using a cached member ID from before the restart
- Consumer took longer than 'session.timeout.ms' between heartbeats due to a GC pause or processing bottleneck, causing broker-side eviction
Solutions
- Increase 'session.timeout.ms' (default 45000ms) and ensure 'heartbeat.interval.ms' is 1/3 of session.timeout.ms; reduce GC pauses on the consumer JVM
- Run heartbeating on a background thread — most modern Kafka clients do this automatically; verify your client version has the background heartbeat thread (librdkafka >= 0.9.3, kafka-python >= 1.3)
- Reduce 'max.poll.records' and processing batch size so the consumer returns to poll() well within 'max.poll.interval.ms'; log a warning if poll interval exceeds 80% of the limit
Example Stack Trace
org.apache.kafka.common.errors.UnknownMemberIdException: The coordinator is not aware of this member.Diagnostic Commands
# Describe consumer group offsets and lag
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group <group> --describe
# Look for heartbeat/session events in logs
grep -E 'UnknownMemberId|Heartbeat|session expired|Member.*left' /var/log/kafka/server.log | tail -20Related
Protocol error: UNKNOWN_MEMBER_ID (code 25)
Related Consumer exceptions: CommitFailedException · CoordinatorLoadInProgressException · CoordinatorNotAvailableException · FencedInstanceIdException · FencedMemberEpochException · GroupMaxSizeReachedException · IllegalGenerationException · InvalidGroupIdException
Hitting
UnknownMemberIdException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.