Kafka Exception CoordinatorNotAvailableException
org.apache.kafka.common.errors.CoordinatorNotAvailableException
Retriable
Consumer
In the context of the group coordinator, the broker returns this error code for metadata or offset commit requests if the group metadata topic has not been created yet. In the context of the transactional coordinator, this error will be returned if the underlying transactional log is under replicated or if an append to the log times out.
Common Causes
- __consumer_offsets topic does not exist yet (first consumer group on a fresh cluster with auto-creation disabled)
- All brokers that host the relevant __consumer_offsets partition are down or unreachable
- Coordinator broker is in the middle of a controlled shutdown and the new coordinator has not yet been elected
Solutions
- Verify __consumer_offsets topic exists: kafka-topics.sh --list --bootstrap-server localhost:9092 | grep __consumer_offsets; if missing, ensure 'auto.create.topics.enable=true' or create it manually
- Check which broker is the coordinator for the group: kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group <group> --describe; verify that broker is running
- Ensure 'offsets.topic.replication.factor' is <= the number of available brokers; a cluster with fewer brokers than this setting will fail to elect a coordinator
Example Stack Trace
org.apache.kafka.common.errors.CoordinatorNotAvailableException: The coordinator is not available.Diagnostic Commands
# Inspect __consumer_offsets topic health
kafka-topics.sh --describe --topic __consumer_offsets --bootstrap-server localhost:9092
# Check which broker is the group coordinator
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group <group> --describe 2>&1 | grep -E 'Coordinator|ERROR'Related
Protocol error: COORDINATOR_NOT_AVAILABLE (code 15)
Related Consumer exceptions: CommitFailedException · CoordinatorLoadInProgressException · FencedInstanceIdException · FencedMemberEpochException · GroupMaxSizeReachedException · IllegalGenerationException · InvalidGroupIdException · InvalidOffsetException
Hitting
CoordinatorNotAvailableException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.