On this page
Kafka troubleshooting
CoordinatorNotAvailableException (COORDINATOR_NOT_AVAILABLE)
org.
The broker answered COORDINATOR_NOT_AVAILABLE (error code 15) because the coordinator for the consumer group cannot serve right now. Usually the partition of the internal topic __consumer_offsets that holds the group does not exist yet, has no live leader, or cannot take writes. The consumer looks the coordinator up again and retries; if the error does not stop, fix that internal topic.
Reproduce it in the playground2 steps beforeProducing normally; one Agent is down. t+2.150s
orders is a WarpStream topic (Agent v857). Three Agents ran here, one per zone, but agent-2 in az-b was hard-killed at 50 and is still down; no client sits in az-b. p-a (ws_az=az-a) writes through agent-1 and p-c (ws_az=az-c) through agent-3. Their first records, k1 and k2, were committed by the control plane at 1450 and acked, and g1's consumer c1 in az-a read them at 1800. Their second records, k3 and k4, are in one file on agent-1 and one on agent-3: both uploads ended at 2100, and the commit requests are with the control plane, not yet answered.
Open at this step: step 1, Producing normally; one Agent is down1 step beforeThe control plane is unreachable: commits fail, files are orphaned. t+2.300s
The control plane stops at 2200, and the Agents notice at once (the simulator's choice). At 2300 both commit requests fail. The files holding k3 and k4 are in object storage, but no commit names them: they are orphans. WarpStream's garbage collection deletes orphans later; the simulator does not model it, so they stay drawn. Neither record was acked, so nothing acked is lost: p-a and p-c each get REQUEST_TIMED_OUT (WarpStream's docs name no code; the simulator's choice) and will retry.
Open at this step: step 2, The control plane is unreachable: commits fail, files are orphanedThe moment it happensProduce is rejected; consumers and the group stop. t+2.550s
WarpStream's docs say that without the control plane an Agent rejects produce and fails every request that needs the control plane. At 2550 p-a's k5 and p-c's k6 are rejected at once with REQUEST_TIMED_OUT, and nothing enters an Agent's buffer. At 2400 c1's fetch failed with REQUEST_TIMED_OUT on every partition, because the list of files to read comes from the control plane, and its offset commit failed with COORDINATOR_NOT_AVAILABLE (the simulator's choice of code), because the control plane coordinates the consumer groups. c1 keeps its partitions but reads and commits nothing.
Open at this step: step 3, Produce is rejected; consumers and the group stopRight afterThe dead Agent cannot start without the control plane. t+2.800s
At 2800 agent-2 is restarted, and the restart is refused: WarpStream's docs say an Agent cannot start without the control plane. The refusal carries InvalidConfigurationException, the simulator's choice: it names a Kafka error on every refusal, and nothing is wrong with any config. agent-2 stays down. The producers keep retrying 400 ms after each error (the simulator's retry backoff): k3 and k4 were sent again at 2700 and rejected the same way.
Open at this step: step 4, The dead Agent cannot start without the control planeWhat it means
Every consumer group is managed by a group coordinator: the broker that leads the partition of __consumer_offsets the group id hashes to. A client finds it with a FindCoordinator request, then sends its joins, heartbeats and offset commits there. In Apache Kafka 4.4 a broker answers FindCoordinator with COORDINATOR_NOT_AVAILABLE in three cases: the internal topic does not exist yet (the broker then asks the controller to create it, and the client has to ask again), the topic's metadata carries an error, or the group's partition has no live leader. The coordinator returns the same code while its service is not active, and when a commit or a group change cannot be written to __consumer_offsets because the write failed with NOT_ENOUGH_REPLICAS, REQUEST_TIMED_OUT or UNKNOWN_TOPIC_OR_PARTITION. The exception's javadoc adds the transactional case: a transaction coordinator returns it when its log, __transaction_state, is under-replicated or an append to it times out. Two neighbouring codes mean something else: COORDINATOR_LOAD_IN_PROGRESS says the coordinator is still loading the group's state after a leader change, and NOT_COORDINATOR says the client asked a broker that is not the coordinator. WarpStream, a Kafka-compatible system, keeps its consumer groups in its hosted control plane rather than in a topic; the simulator answers group calls with COORDINATOR_NOT_AVAILABLE while that control plane is unreachable, which is its own choice of code. Scenarios 10.1.4 and 10.1.5 show it. Nisshi (formerly Tansu), a Kafka-compatible broker, has no __consumer_offsets topic: its storage engine keeps the group state and the committed offsets, and FindCoordinator answers the broker that received it. While the engine is unavailable, Nisshi 0.8.2 answers offset commits and group requests with COORDINATOR_NOT_AVAILABLE. Scenario 12.1.6 shows it on the PostgreSQL engine.
Likely causes, most common first
- A new cluster cannot create __consumer_offsets. The topic is created on first use with offsets.topic.replication.factor replicas (3 by default) and offsets.topic.num.partitions partitions (50 by default). On a development cluster with fewer brokers than that replication factor the controller cannot place the replicas, so the topic is never created and every consumer group keeps getting COORDINATOR_NOT_AVAILABLE. Transactions hit the same wall with transaction.state.log.replication.factor.
- The group's partition of __consumer_offsets has no leader. The brokers that hold the replicas of that partition are down or cut off, so no broker can coordinate the groups that hash to it. Groups on other partitions carry on. The error clears when a replica comes back and is elected leader.
- Writes to __consumer_offsets fail. The coordinator writes offset commits and group changes to the internal topic and waits for its in-sync replicas. With fewer in-sync replicas than min.insync.replicas, or replication slower than the coordinator's write timeout, the write fails with NOT_ENOUGH_REPLICAS or REQUEST_TIMED_OUT and the client gets COORDINATOR_NOT_AVAILABLE instead.
- The coordinator broker is starting or shutting down. While the coordinator service on a broker is not active, it refuses group requests with this code. A rolling restart produces a short burst of it; the clients find the new coordinator and go on.
- WarpStream (not Apache Kafka): the control plane is unreachable. WarpStream runs consumer group coordination in its hosted control plane. While the control plane is unreachable, group calls fail; WarpStream's docs name no error code, so the simulator answers offset commits and group joins with COORDINATOR_NOT_AVAILABLE. The group keeps its assignment, commits nothing during the outage, and commits again once the control plane is back. Ripcord does not change this: it lets the Agents keep taking produce during the outage, but WarpStream's Ripcord page says consumers stop, and the simulator fails their group calls the same way.
- Nisshi: its storage engine is unavailable. On a Nisshi cluster the group state and committed offsets are in PostgreSQL, or in S3 on its experimental engine. While that store is down, offset commits and group changes get COORDINATOR_NOT_AVAILABLE; once it is back they succeed again, and asking another broker does not help.
How to fix it
- Describe the internal topic with kafka-topics.sh --describe --topic __consumer_offsets and look for partitions with no leader or a short ISR; if the topic is missing, check that the cluster has at least offsets.topic.replication.factor live brokers.
- On a single-broker or two-broker development cluster, set offsets.topic.replication.factor (and transaction.state.log.replication.factor) to the broker count before the first group or transaction uses the cluster. The setting applies when the topic is created; to change the replication factor of an existing topic, reassign its partitions.
- Bring back the brokers that hold the leaderless partition, and keep the internal topics on brokers in different racks or zones so one failure cannot take a partition down.
- Let the client retry. With commitAsync(), treat a RetriableCommitFailedException as a commit that a later one will cover, rather than resending an old offset.
- On WarpStream, bring the control plane back or wait for it: the consumers retry and commit again on their own.
- On Nisshi, bring the storage engine back; the consumer commits again at its next poll.
What not to do
- Deleting __consumer_offsets, or recreating it, to clear the error: it holds every group's committed offsets, and the groups lose their positions.
Does the client retry it?
Yes, the client retries. COORDINATOR_NOT_AVAILABLE (error code 15) is retriable: CoordinatorNotAvailableException extends RefreshRetriableException, so the consumer marks its coordinator unknown, looks it up again and retries. commitSync() keeps retrying until its timeout runs out; commitAsync() hands its callback a RetriableCommitFailedException, and a later commit covers the same offsets. The error reaches the application only when the cause outlasts those timeouts.
Reproduce it in the simulator
- WarpStream Kafka: the control plane goes down (WarpStream: the control plane is unreachable) Open at the moment it happens: WarpStream Kafka: the control plane goes down
- WarpStream Kafka Ripcord: produce without the control plane (WarpStream: Ripcord) Open at the moment it happens: WarpStream Kafka Ripcord: produce without the control plane
- Nisshi diskless Kafka: when PostgreSQL goes down (Nisshi: PostgreSQL unavailable) Open at the moment it happens: Nisshi diskless Kafka: when PostgreSQL goes down
Sources
- Apache Kafka 4.4 javadoc: CoordinatorNotAvailableException
- Apache Kafka 4.4.0 source: Errors.java (COORDINATOR_NOT_AVAILABLE, code 15)
- Apache Kafka 4.4.0 source: KafkaApis.scala (FindCoordinator)
- Apache Kafka 4.4.0 source: CoordinatorOperationExceptionHelper.java (failed writes map to COORDINATOR_NOT_AVAILABLE)
- Apache Kafka 4.4.0 source: ConsumerCoordinator.java (commit retries)
- Apache Kafka 4.4: broker config offsets.topic.replication.factor
- WarpStream docs: service discovery (consumer group coordination in the control plane)
- WarpStream docs: Ripcord (requests that need the control plane fail without it)
- Nisshi v0.8.2: consumer groups