conduktor.io ↗

Kafka Exception StaleMemberEpochException

org.apache.kafka.common.errors.StaleMemberEpochException
Non-retriable Consumer

The StaleMemberEpochException is used in the context of the new consumer group protocol (KIP-848). This error is returned in the OffsetCommit/Fetch APIs when the member epoch received does not match the current member epoch.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.common.errors.StaleMemberEpochException: The member epoch is stale. The member must retry after receiving its updated member epoch via the ConsumerGroupHeartbeat API.

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 -50

Related

Protocol error: STALE_MEMBER_EPOCH (code 113)

Related Consumer exceptions: CommitFailedException · CoordinatorLoadInProgressException · CoordinatorNotAvailableException · FencedInstanceIdException · FencedMemberEpochException · GroupMaxSizeReachedException · IllegalGenerationException · InvalidGroupIdException

Hitting StaleMemberEpochException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.