{"record":{"id":"3ddfc4872729abb2","repo":"cloudflare/quiche","slug":"error-creating-qlog-file-attempted-path-was-path-3ddfc4","errorCode":null,"errorMessage":"Error creating qlog file attempted path was {path:?}: {e}","messagePattern":"Error creating qlog file attempted path was (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"h3i/src/main.rs","lineNumber":448,"sourceCode":"}\n\n/// Makes a buffered writer for a qlog.\npub fn make_qlog_writer() -> std::io::BufWriter<std::fs::File> {\n    let mut path = std::env::current_dir().unwrap();\n    let now = time::SystemTime::now();\n    let filename = format!(\n        \"{}-qlog.sqlog\",\n        now.duration_since(time::UNIX_EPOCH).unwrap().as_millis()\n    );\n    path.push(filename.clone());\n\n    log::info!(\"Session will be recorded to {filename}\");\n\n    match std::fs::File::create(&path) {\n        Ok(f) => std::io::BufWriter::new(f),\n\n        Err(e) =>\n            panic!(\"Error creating qlog file attempted path was {path:?}: {e}\"),\n    }\n}\n\npub fn make_streamer(\n    writer: Box<dyn std::io::Write + Send + Sync>,\n) -> qlog::streamer::QlogStreamer {\n    let vp = qlog::VantagePointType::Client;\n\n    let trace = qlog::TraceSeq::new(\n        Some(\"h3i\".into()),\n        Some(\"h3i\".into()),\n        None,\n        Some(qlog::VantagePoint {\n            name: None,\n            ty: vp,\n            flow: None,\n        }),\n        vec![QUIC_URI.to_string(), HTTP3_URI.to_string()],","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/h3i/src/main.rs#L430-L466","documentation":"h3i panics when it cannot create the qlog file at the path the user supplied on the command line, right before writing session traces. std::fs::File::create failed, which means the directory doesn't exist, the path is invalid, or the process lacks write permission. This is a hard abort: without a qlog sink the session cannot be recorded.","triggerScenarios":"Running the h3i binary with a --qlog-style filename whose parent directory is missing, unwritable, or whose path is otherwise invalid, causing File::create to return Err.","commonSituations":"Typo in output directory; running in a read-only container or restricted CI sandbox; relative path resolved from an unexpected working directory; filename containing characters invalid on the filesystem.","solutions":["Create the target directory first (mkdir -p <dir>) and re-run.","Check write permissions on the directory, or run from a writable location.","Verify the --qlog filename argument for typos and use an absolute path to avoid working-directory surprises."],"exampleFix":"// before\nh3i --qlog out/trace.qlog ...\n// after\nmkdir -p out && h3i --qlog out/trace.qlog ...","handlingStrategy":"validation","validationCode":"// shell\n[ -d \"$(dirname \"$QLOG_PATH\")\" ] && [ -w \"$(dirname \"$QLOG_PATH\")\" ] || mkdir -p \"$(dirname \"$QLOG_PATH\")\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always create the qlog output directory before running h3i.","Use absolute, writable paths in CI sandboxes."],"tags":["h3i","qlog","filesystem","file-create"],"backgroundTag":"file-write-failed","analyzedSha":"9f96daa2c22a4468b0036fb0a0a3894eee6498b8","analyzedAt":"2026-09-08T11:27:09.536Z","contentChangedAt":"2026-09-08T11:27:09.536Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}