{"record":{"id":"146f2d1511b85cf3","repo":"quickwit-oss/quickwit","slug":"index-id-pattern-pattern-is-invalid-an-index","errorCode":null,"errorMessage":"index ID pattern `{pattern}` is invalid: an index ID must have at least 3 characters","messagePattern":"index ID pattern `(.+?)` is invalid: an index ID must have at least 3 characters","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-config/src/lib.rs","lineNumber":199,"sourceCode":"    // as multiple stars does not bring any value.\n    if pattern.contains(\"**\") {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: patterns must not contain multiple \\\n             consecutive `*`\"\n        );\n    }\n    // If there is no star in the pattern, we need at least 3 characters.\n    if !pattern.contains('*') && pattern.len() < 3 {\n        bail!(\n            \"index ID pattern `{pattern}` is invalid: an index ID must have at least 3 characters\"\n        );\n    }\n    Ok(())\n}\n\npub fn validate_node_id(node_id: &NodeIdRef) -> anyhow::Result<()> {\n    if !is_valid_hostname(node_id.as_str()) {\n        bail!(\n            \"node identifier `{node_id}` is invalid. node identifiers must be valid short \\\n             hostnames (see RFC 1123)\"\n        );\n    }\n    Ok(())\n}\n\n#[derive(Copy, Clone, Debug, Eq, PartialEq)]\npub enum ConfigFormat {\n    Json,\n    Toml,\n    Yaml,\n}\n\nimpl ConfigFormat {\n    pub fn as_str(&self) -> &'static str {\n        match self {\n            ConfigFormat::Json => \"json\",","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-config/src/lib.rs#L181-L217","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use an index ID of at least 3 characters (matching the real index ID you intend to address).","If you actually want prefix matching, add a `*` (e.g. `lo*`) — wildcard patterns are exempt from the 3-char minimum.","Rename the index to a longer, descriptive identifier in both config and ingestion calls."],"exampleFix":"// before\nindex_id: \"ab\"\n// after\nindex_id: \"abc\" // or \"ab*\" for prefix matching","handlingStrategy":"validation","validationCode":"fn is_valid_index_id_pattern(pattern: &str) -> bool {\n    pattern.contains('*') || pattern.len() >= 3\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce a >= 3 character minimum on index IDs in your own tooling/CI.","Avoid placeholder IDs like \"a\" or \"ab\" in tests if they will be validated by quickwit-config.","Prefer descriptive index names; use `*` suffixes for prefix matching instead of short exact IDs."],"tags":["config","validation","identifier","quickwit"],"backgroundTag":"invalid-identifier-format","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}