quickwit-oss/quickwit · error

topic `{}` has no partitions

Error message

topic `{}` has no partitions

What it means

During Kafka source connectivity checks, the topic exists in the cluster metadata but reports zero partitions. With no partitions there is nothing to consume, which usually indicates a miscreated or misconfigured topic, so the source refuses to start.

Source

Thrown at quickwit/quickwit-indexing/src/source/kafka_source.rs:649

        .create()?;

    let topic = params.topic.clone();
    let timeout = Timeout::After(Duration::from_secs(5));
    let cluster_metadata = spawn_blocking(move || {
        consumer
            .fetch_metadata(Some(&topic), timeout)
            .with_context(|| format!("failed to fetch metadata for topic `{topic}`"))
    })
    .await??;

    if cluster_metadata.topics().is_empty() {
        bail!("topic `{}` does not exist", params.topic);
    }
    let topic_metadata = &cluster_metadata.topics()[0];
    assert_eq!(topic_metadata.name(), params.topic); // Belt and suspenders.

    if topic_metadata.partitions().is_empty() {
        bail!("topic `{}` has no partitions", params.topic);
    }
    Ok(())
}

/// Creates a new `KafkaSourceConsumer`.
fn create_consumer(
    index_uid: &IndexUid,
    source_id: &str,
    params: KafkaSourceParams,
    events_tx: mpsc::Sender<KafkaEvent>,
) -> anyhow::Result<(ClientConfig, RdKafkaConsumer, GroupId)> {
    // Group ID is limited to 255 characters.
    let mut group_id = match &params.client_params["group.id"] {
        JsonValue::String(group_id) => group_id.clone(),
        _ => format!("quickwit-{index_uid}-{source_id}"),
    };
    group_id.truncate(255);

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Recreate or reconfigure the Kafka topic with at least one partition
  2. Verify you connected to the intended Kafka cluster and typed the topic name correctly
Defensive patterns

Strategy: validation

Validate before calling

kafka-metadata --bootstrap-server $BROKERS --topic $TOPIC | jq -e '.partitions | length > 0'

Try / catch

// retry connectivity check; transient metadata states often resolve
for _ in 0..3 {
    if check_connectivity(...).await.is_ok() { break; }
    tokio::time::sleep(Duration::from_secs(5)).await;
}

Prevention

When it happens

Trigger: `check_connectivity` inspects `topic_metadata.partitions()` after fetching topic metadata; the list is empty, triggering the bail.

Common situations: Topic in a transient/deleting state; brokers returning inconsistent metadata; a misconfigured or broken cluster reporting a partitionless topic.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/4ab041a1aaaa0e77. Report an issue: GitHub.