cloudflare/quiche · error · io::Error

Unsupported

Unsupported

Error message

qlog file {name:?} requires the `gzip` feature on the qlog crate to decode

What it means

qlog's with_file can decode gzip-compressed .sqlog.gz files only when the qlog crate was built with the `gzip` feature (which pulls in flate2). Without it, opening such a file returns io::ErrorKind::Unsupported telling you the feature is required.

Solutions

  1. Enable the feature in Cargo.toml: qlog = { version = "...", features = ["gzip"] }
  2. Pre-decompress the file with gunzip and open the resulting .sqlog
  3. Use a different reader that supports gzip independently

Example fix

// before (Cargo.toml)
qlog = "0.x"
// after (Cargo.toml)
qlog = { version = "0.x", features = ["gzip"] }
Defensive patterns

Strategy: fallback

Validate before calling

let gz_enabled = cfg!(feature = "gzip"); // in a crate that depends on qlog, check via the path suffix
if name.ends_with(".sqlog.gz") && !cfg!(feature = "qlog/gzip") { /* decompress externally */ }

Try / catch

match QlogReader::with_file(&path) {
    Err(e) if e.kind() == io::ErrorKind::Unsupported => {
        // decompress with external gunzip and retry
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling qlog::reader with a file whose name ends with .sqlog.gz while the qlog dependency was compiled without features = ["gzip"].

Common situations: Using default qlog features in Cargo.toml and then feeding .gz qlog files (common, since Chrome/tools often gzip qlogs); feature unification turning the feature off in the workspace.

Related errors


AI-assisted analysis of cloudflare/quiche@9f96daa2c2 (2026-09-08). Data as JSON: /api/errors/c3ec964b34e8c0e0. Report an issue: GitHub.

Appendix: source

Thrown at qlog/src/reader.rs:119

        let name = path.file_name().and_then(|s| s.to_str()).unwrap_or("");

        // Order matters: `.sqlog.gz` and `.sqlog.zst` must be tested
        // before `.sqlog` (every compressed suffix also ends with
        // `.sqlog` if you only look at the last extension).
        //
        // Each compound suffix is matched exactly once. The
        // `#[cfg(feature = "...")]` lives inside the `if` body so the
        // disabled-feature path can return a helpful error rather
        // than falling through to the unknown-extension branch.
        if name.ends_with(SQLOG_GZ_EXT) {
            #[cfg(feature = "gzip")]
            {
                let reader: Box<dyn std::io::BufRead + Send + Sync> =
                    Box::new(BufReader::new(flate2::read::GzDecoder::new(file)));
                return Self::new(reader);
            }
            #[cfg(not(feature = "gzip"))]
            return Err(std::io::Error::new(
                std::io::ErrorKind::Unsupported,
                format!(
                    "qlog file {name:?} requires the `gzip` feature on \
                     the qlog crate to decode"
                ),
            )
            .into());
        }
        if name.ends_with(SQLOG_ZST_EXT) {
            #[cfg(feature = "zstd")]
            {
                let decoder = zstd::Decoder::new(file)?;
                let reader: Box<dyn std::io::BufRead + Send + Sync> =
                    Box::new(BufReader::new(decoder));
                return Self::new(reader);
            }
            #[cfg(not(feature = "zstd"))]
            return Err(std::io::Error::new(

View on GitHub (pinned to 9f96daa2c2)