conduktor.io ↗

Kafka Exception UnknownTopicOrPartitionException

org.apache.kafka.common.errors.UnknownTopicOrPartitionException
Retriable Broker

This topic/partition doesn't exist. This exception is used in contexts where a topic doesn't seem to exist based on possibly stale metadata. This exception is retriable because the topic or partition might subsequently be created.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition.

Diagnostic Commands

# Describe topic partitions, leaders, and ISR kafka-topics.sh --describe --topic <topic> --bootstrap-server localhost:9092 # List topics and search for the target topic kafka-topics.sh --list --bootstrap-server localhost:9092 | grep <topic>

Related

Protocol error: UNKNOWN_TOPIC_OR_PARTITION (code 3)

Related Broker exceptions: CorruptRecordException · FencedLeaderEpochException · LeaderNotAvailableException · NetworkException · NotEnoughReplicasAfterAppendException · NotEnoughReplicasException · NotLeaderOrFollowerException · TimeoutException

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