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

index ID pattern `{pattern}` is invalid: an index ID must ha

Error message

index ID pattern `{pattern}` is invalid: an index ID must have at least 3 characters

What it means

quickwit-config requires index ID patterns without a wildcard to be at least 3 characters long. An index ID is a real identifier, and short IDs are error-prone (typos, ambiguous prefixes), so `validate_index_id_pattern` bails when a star-less pattern is shorter than 3 characters. The error surfaces wherever index config validation runs.

Source

Thrown at quickwit/quickwit-config/src/lib.rs:199

    // as multiple stars does not bring any value.
    if pattern.contains("**") {
        bail!(
            "index ID pattern `{pattern}` is invalid: patterns must not contain multiple \
             consecutive `*`"
        );
    }
    // If there is no star in the pattern, we need at least 3 characters.
    if !pattern.contains('*') && pattern.len() < 3 {
        bail!(
            "index ID pattern `{pattern}` is invalid: an index ID must have at least 3 characters"
        );
    }
    Ok(())
}

pub fn validate_node_id(node_id: &NodeIdRef) -> anyhow::Result<()> {
    if !is_valid_hostname(node_id.as_str()) {
        bail!(
            "node identifier `{node_id}` is invalid. node identifiers must be valid short \
             hostnames (see RFC 1123)"
        );
    }
    Ok(())
}

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ConfigFormat {
    Json,
    Toml,
    Yaml,
}

impl ConfigFormat {
    pub fn as_str(&self) -> &'static str {
        match self {
            ConfigFormat::Json => "json",

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Use an index ID of at least 3 characters (matching the real index ID you intend to address).
  2. If you actually want prefix matching, add a `*` (e.g. `lo*`) — wildcard patterns are exempt from the 3-char minimum.
  3. Rename the index to a longer, descriptive identifier in both config and ingestion calls.

Example fix

// before
index_id: "ab"
// after
index_id: "abc" // or "ab*" for prefix matching
Defensive patterns

Strategy: validation

Validate before calling

fn is_valid_index_id_pattern(pattern: &str) -> bool {
    pattern.contains('*') || pattern.len() >= 3
}

Prevention

When it happens

Trigger: Calling `validate_index_id_pattern("ab")` (or 1–2 character star-less strings) via config `validate`, `build_regex_set`, `build_index_id_patterns_sql_query`, `extract_otel_traces_index_id_patterns_from_metadata`, or `es_compat_index_multi_search`. Note: adding a `*` exempts the pattern from the length rule.

Common situations: Typo'd or truncated index IDs in quickwit.yaml; tests or scripts using tiny placeholder IDs like `"a"` or `"x1"`; users coming from other systems that allow 1–2 char index names.

Understand the failure class

Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.

Related errors


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