Kafka
Topic Creation
Node Assignment
Timeout Issues
Programming Troubleshooting

Kafka topic creation: Timed out waiting for a node assignment

Codemia Knowledge Hub ·

"Timed out waiting for a node assignment" during Kafka topic creation means the client could not get a broker to handle the request. It is usually caused by brokers that are down or unreachable, network problems, an unhealthy Zookeeper cluster, or configuration errors. Start by confirming the brokers are up with kafka-broker-api-versions.sh, then check connectivity, Zookeeper, and the logs.

Why the node assignment times out

  • Broker unavailability: If the Kafka brokers are not running or cannot be reached, no broker is available to handle the topic creation request.
  • Network issues: Connectivity problems between the client and the brokers, or between the brokers themselves, can cause the error.
  • Zookeeper issues: Kafka relies on Zookeeper for broker coordination and metadata storage. Disruptions in the Zookeeper cluster, such as leader election problems or network partitions, can block topic creation.
  • Configuration errors: Misconfigured Kafka or Zookeeper settings can prevent brokers from registering or syncing data.

An example: a network partition

  1. Broker 1 and Broker 2 start on a network that then becomes partially isolated.
  2. kafka-topics.sh is run to create a new topic.
  3. Because of the partition, the script cannot reach the active brokers or the Zookeeper leader, and it times out.

Fixing the timeout

  • Validate broker status: Make sure every intended broker is running, for example with kafka-broker-api-versions.sh.
  • Check network connectivity: Use tools like ping or netstat to verify connectivity between brokers, and between brokers and Zookeeper.
  • Inspect Zookeeper health: Confirm Zookeeper is healthy and the leader can talk to all other ensemble members.
  • Review logs: Kafka and Zookeeper logs often show what is causing the communication or operational failure.

List the brokers that respond:

bash
  kafka-broker-api-versions.sh --bootstrap-server localhost:9092

Check that a broker is reachable:

bash
  ping <broker_ip>

Checks by cause

Issue SourceVerification MethodPossible Solution
Broker Unavailabilitykafka-broker-api-versions.shEnsure all brokers are online and functioning.
Network Issuesping, tracerouteCheck and fix network connectivity.
Zookeeper IssuesZookeeper logs, zkCli.shSolve leader election issues, ensure all nodes are synced.
Configuration ErrorsKafka/Zookeeper configuration filesDouble-check and correct configuration settings.

Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design