conduktor.io ↗

Kafka Exception NotCoordinatorException

org.apache.kafka.common.errors.NotCoordinatorException
Retriable Consumer

In the context of the group coordinator, the broker returns this error code if it receives an offset fetch or commit request for a group it's not the coordinator of. In the context of the transactional coordinator, it returns this error when it receives a transactional request with a transactionalId the coordinator doesn't own.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.common.errors.NotCoordinatorException: This is not the correct coordinator.

Diagnostic Commands

# Check for leaderless __consumer_offsets partitions kafka-topics.sh --describe --topic __consumer_offsets --bootstrap-server localhost:9092 | grep 'Leader: none' # Look for related errors in broker logs grep -E 'NotCoordinator|FindCoordinator|Coordinator for group' /var/log/kafka/server.log | tail -20

Related

Protocol error: NOT_COORDINATOR (code 16)

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

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