Home / Kafka / Brokers and partitions
Kafka: UnknownTopicOrPartitionException: This server does not host this topic-partition
org.apache.kafka.common.errors.UnknownTopicOrPartitionExceptionThis server does not host this topic-partition.The broker that received the request has no replica of the partition. Right after a topic is created or deleted this is temporary; if it persists, the topic does not exist or the client is using stale metadata.
Common causes
- The topic was just created and metadata has not propagated yet.How to confirm: The warning stops after a few seconds.
- The topic does not exist, or was deleted while clients still use it.How to confirm: kafka-topics --list does not show the topic.
- The client requests a partition number higher than the topic has.How to confirm: A custom partitioner or a hard-coded partition number exceeds the partition count.
How to fix it
Create the topic with the expected partition count, and check custom partitioners against the real number of partitions.
Where the message comes from
Errors.javainapache/kafkaat4.3.2- Message checked in Kafka 4.3.2