cloudflare/quiche · error

Error creating qlog file attempted path was

Error message

Error creating qlog file attempted path was {path:?}: {e}

What it means

make_qlog_writer panics when the qlog trace file cannot be created at the requested path. quiche's Config::log_events/qlog setup needs a writable file; if File::create fails the process aborts before the connection starts, with the path and io::Error in the message.

Solutions

  1. Ensure the qlog output directory exists and is writable (mkdir -p).
  2. Verify the path in the error message is what you intended.
  3. Check filesystem permissions or free space.
  4. Disable qlog if tracing is not needed.

Example fix

// before
quiche-client --qlog-dir /var/qlog https://example.org:4433
// after
mkdir -p /var/qlog && quiche-client --qlog-dir /var/qlog https://example.org:4433
Defensive patterns

Strategy: validation

Validate before calling

let qlog_dir = std::path::Path::new("/var/qlog");
std::fs::create_dir_all(qlog_dir).expect("cannot create qlog dir");
assert!(qlog_dir.is_dir());

Prevention

When it happens

Trigger: Enabling qlog (e.g. --qlog-dir or connect() with qlog options) where filename/path points into a non-existent or unwritable directory.

Common situations: Wrong --qlog-dir path, missing directory, read-only container filesystem, or insufficient permissions when running as a non-root user.

Understand the failure class

Background: "open() failed", "failed to open file", "cannot create file" — what a file open error means and how to fix it — this error's family across 42 libraries.

Related errors


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

Appendix: source

Thrown at apps/src/common.rs:160

        }
    }

    path
}

/// Makes a buffered writer for a qlog.
pub fn make_qlog_writer(
    dir: &std::ffi::OsStr, role: &str, id: &str,
) -> std::io::BufWriter<std::fs::File> {
    let mut path = std::path::PathBuf::from(dir);
    let filename = format!("{role}-{id}.sqlog");
    path.push(filename);

    match std::fs::File::create(&path) {
        Ok(f) => std::io::BufWriter::new(f),

        Err(e) =>
            panic!("Error creating qlog file attempted path was {path:?}: {e}"),
    }
}

fn dump_json(reqs: &[Http3Request], output_sink: &mut dyn FnMut(String)) {
    let mut out = String::new();

    writeln!(out, "{{").unwrap();
    writeln!(out, "  \"entries\": [").unwrap();
    let mut reqs = reqs.iter().peekable();

    while let Some(req) = reqs.next() {
        writeln!(out, "  {{").unwrap();
        writeln!(out, "    \"request\":{{").unwrap();
        writeln!(out, "      \"headers\":[").unwrap();

        let mut req_hdrs = req.hdrs.iter().peekable();
        while let Some(h) = req_hdrs.next() {
            writeln!(out, "        {{").unwrap();

View on GitHub (pinned to 9f96daa2c2)