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

file extension `.{ext}` is not supported. supported file for

Error message

file extension `.{ext}` is not supported. supported file formats and extensions are JSON (.json), TOML (.toml), and YAML (.yaml or .yml)

What it means

quickwit-config loads configuration files by dispatching on their extension via `ConfigFormat::from_str`. Only `.json`, `.toml`, `.yaml`, and `.yml` are supported; any other extension causes this bail. The check exists so the parser knows which deserializer to use for the file.

Source

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

                    toml::from_str(payload_str).context("failed to parse TOML file")
                }
            }
            ConfigFormat::Yaml => {
                serde_yaml::from_slice(payload).context("failed to parse YAML file")
            }
        }
    }
}

impl FromStr for ConfigFormat {
    type Err = anyhow::Error;

    fn from_str(ext: &str) -> anyhow::Result<Self> {
        match ext {
            "json" => Ok(Self::Json),
            "toml" => Ok(Self::Toml),
            "yaml" | "yml" => Ok(Self::Yaml),
            _ => bail!(
                "file extension `.{ext}` is not supported. supported file formats and extensions \
                 are JSON (.json), TOML (.toml), and YAML (.yaml or .yml)",
            ),
        }
    }
}

pub trait TestableForRegression: Serialize + DeserializeOwned {
    /// Produces an instance of `Self` whose serialization output will be tested against future
    /// versions of the format for backward compatibility.
    fn sample_for_regression() -> Self;

    /// Asserts that `self` and `other` are equal. It must panic if they are not.
    fn assert_equality(&self, other: &Self);
}

/// Returns a fingerprint (a hash) of all the parameters that should force an
/// indexing pipeline to restart upon index or source config updates.

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Rename the file to use a supported extension: `.json`, `.toml`, `.yaml`, or `.yml`.
  2. If the content is actually YAML, prefer `.yaml`; check for accidental double extensions like `.yaml.txt`.
  3. Fix the path passed via `--config`/`QW_CONFIG` so it points to a correctly-named file.

Example fix

// before
./quickwit serve --config ./quickwit.conf
// after
./quickwit serve --config ./quickwit.yaml
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED: [&str; 4] = ["json", "toml", "yaml", "yml"];
fn has_supported_config_ext(path: &std::path::Path) -> bool {
    path.extension()
        .and_then(|e| e.to_str())
        .map(|e| SUPPORTED.contains(&e.to_ascii_lowercase().as_str()))
        .unwrap_or(false)
}

Try / catch

// Rust
match ConfigFormat::from_str(ext) {
    Ok(fmt) => load_with(fmt),
    Err(e) => { eprintln!("{e:#}"); std::process::exit(1); }
}

Prevention

When it happens

Trigger: Passing a config file path with an unsupported extension (e.g. `config.yml5`, `quickwit.conf`, `config.txt`) to config loading (CLI `--config` flag, `quickwit serve`, or `load_config` variants).

Common situations: Renamed config files (e.g. `quickwit.yaml.bak` still being referenced); using `.conf` or `.cfg` out of habit; environment-variable-supplied paths with trailing junk; Windows-style `.yml.txt` double extensions from editor saves.

Related errors


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