quickwit-oss/quickwit · error · anyhow::Error

the `compactor` service can only be enabled when `enable_sta

Error message

the `compactor` service can only be enabled when `enable_standalone_compactors` is true (or `QW_ENABLE_STANDALONE_COMPACTORS=true`). With the default indexer-local merge pipeline, the compactor service must not be enabled.

What it means

Quickwit's node configuration validation rejects enabling the `compactor` service unless standalone compactors are explicitly enabled via `enable_standalone_compactors` (config) or `QW_ENABLE_STANDALONE_COMPACTORS=true` (env). By default, merge/compaction runs locally inside each indexer's pipeline, so listing a separate compactor service is a misconfiguration. The check runs in `validate()` during `build_and_validate`, so node startup fails fast.

Source

Thrown at quickwit/quickwit-config/src/node_config/serialize.rs:414

        Ok(node_config)
    }
}

fn validate(node_config: &NodeConfig) -> anyhow::Result<()> {
    validate_identifier("cluster", &node_config.cluster_id)?;
    validate_node_id(&node_config.node_id)?;

    if node_config.cluster_id == DEFAULT_CLUSTER_ID {
        warn!("cluster ID is not set, falling back to default value `{DEFAULT_CLUSTER_ID}`",);
    }
    if node_config.peer_seeds.is_empty() {
        warn!("peer seeds are empty");
    }
    validate_metastore_read_replica(node_config)?;
    if node_config.is_service_enabled(QuickwitService::Compactor)
        && !node_config.enable_standalone_compactors
    {
        bail!(
            "the `compactor` service can only be enabled when `enable_standalone_compactors` is \
             true (or `QW_ENABLE_STANDALONE_COMPACTORS=true`). With the default indexer-local \
             merge pipeline, the compactor service must not be enabled."
        );
    }
    validate_disk_usage(node_config);
    Ok(())
}

/// Validates the configuration of the [`QuickwitService::MetastoreReadReplica`] role and searcher
/// read-replica routing.
///
/// The [`QuickwitService::MetastoreReadReplica`] role serves the same gRPC service as a read-only
/// metastore, so it must run standalone and requires `metastore_read_replica_uri` to connect to.
fn validate_metastore_read_replica(node_config: &NodeConfig) -> anyhow::Result<()> {
    let read_replica_enabled =
        node_config.is_service_enabled(QuickwitService::MetastoreReadReplica);
    if read_replica_enabled {

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Set `enable_standalone_compactors: true` in the node config (or env `QW_ENABLE_STANDALONE_COMPACTORS=true`) if you intend to run dedicated compactor nodes.
  2. Remove `compactor` from the `service` list so compaction runs inside the indexers (default behavior).
  3. Check environment overrides (`QW_SERVICE`, `QW_ENABLE_STANDALONE_COMPACTORS`) align with the YAML config.

Example fix

# before
service: [searcher, compactor]

# after (option A: standalone compactors)
service: [compactor]
enable_standalone_compactors: true

# after (option B: indexer-local compaction)
service: [searcher, indexer]
Defensive patterns

Strategy: validation

Validate before calling

// before starting the node
if services.contains(&QuickwitService::Compactor)
    && !node_config.enable_standalone_compactors
{
    return Err(anyhow!(
        "compactor service requires enable_standalone_compactors=true \
         (or QW_ENABLE_STANDALONE_COMPACTORS=true)"
    ));
}

Try / catch

match NodeConfig::load_and_validate(&uri, &instance_name) {
    Ok(cfg) => start_node(cfg),
    Err(e) if e.to_string().contains("enable_standalone_compactors") => {
        eprintln!("fix node config: {}", e);
        std::process::exit(2);
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Starting a Quickwit node with `service: [compactor, ...]` in node config (or `QW_SERVICE=compactor`) while `enable_standalone_compactors` is false/unset.

Common situations: Operators copying a standalone-compactor deployment example without setting the flag; leftover `compactor` entries in configs from older versions; setting the QW_SERVICE env var to include compactor in docker-compose.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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