quickwit-oss/quickwit · error

compactor service enabled but no compaction client available

Error message

compactor service enabled but no compaction client available

What it means

When the node is configured as a compactor (compactor service enabled), serve_quickwit expects an optional compaction service client to have been created earlier. The expect enforces the invariant that an enabled compactor always has a client; None means the configuration-to-client wiring failed upstream.

Source

Thrown at quickwit/quickwit-serve/src/lib.rs:860

        )
        .await
        .context("failed to start janitor service")?;
        Some(janitor_service)
    } else {
        None
    };

    let compactor_supervisor_opt = if node_config.is_service_enabled(QuickwitService::Compactor)
        && node_config.enable_standalone_compactors
    {
        let compaction_dir = node_config.data_dir_path.join("compaction");
        fs::create_dir_all(&compaction_dir)?;
        let compaction_root_directory = quickwit_common::temp_dir::Builder::default()
            .tempdir_in(&compaction_dir)
            .context("failed to create compaction temp directory")?;
        let compaction_client = compaction_service_client_opt
            .clone()
            .expect("compactor service enabled but no compaction client available");
        let split_cache = indexing_split_cache.clone();
        let compactor_mailbox = start_compactor_service(
            &universe,
            cluster.self_node_id(),
            compaction_client,
            &node_config.compactor_config,
            primary_metastore_client.clone(),
            storage_resolver.clone(),
            split_cache,
            event_broker.clone(),
            compaction_root_directory,
        )
        .await
        .context("failed to start compactor service")?;
        Some(compactor_mailbox)
    } else {
        None
    };

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Review the compactor section of quickwit.yaml: it must be complete and consistent when compaction is enabled
  2. Trace where compaction_service_client_opt is set and confirm it covers the enabled case
  3. Validate the config with quickwit's config checker before startup
  4. If wiring is broken after a code change, restore client construction for the enabled path
Defensive patterns

Strategy: validation

Validate before calling

// Validate config before starting the node:
if node_config.compactor_config.enabled && compaction_service_client_opt.is_none() {
    return Err(anyhow!("compactor enabled but compaction client missing"));
}

Prevention

When it happens

Trigger: node_config.compactor_config enables the compactor but the code path that builds compaction_service_client_opt did not run or returned None (e.g. missing/garbled configuration section or a bug in client construction).

Common situations: Config file with compactor.enabled: true but malformed/absent compaction client settings; refactoring that reordered client initialization before the flag check.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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