{"record":{"id":"dff1eae45e559e4d","repo":"cloudflare/quiche","slug":"error-creating-qlog-file-attempted-path-was-path","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":"apps/src/common.rs","lineNumber":160,"sourceCode":"        }\n    }\n\n    path\n}\n\n/// Makes a buffered writer for a qlog.\npub fn make_qlog_writer(\n    dir: &std::ffi::OsStr, role: &str, id: &str,\n) -> std::io::BufWriter<std::fs::File> {\n    let mut path = std::path::PathBuf::from(dir);\n    let filename = format!(\"{role}-{id}.sqlog\");\n    path.push(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\nfn dump_json(reqs: &[Http3Request], output_sink: &mut dyn FnMut(String)) {\n    let mut out = String::new();\n\n    writeln!(out, \"{{\").unwrap();\n    writeln!(out, \"  \\\"entries\\\": [\").unwrap();\n    let mut reqs = reqs.iter().peekable();\n\n    while let Some(req) = reqs.next() {\n        writeln!(out, \"  {{\").unwrap();\n        writeln!(out, \"    \\\"request\\\":{{\").unwrap();\n        writeln!(out, \"      \\\"headers\\\":[\").unwrap();\n\n        let mut req_hdrs = req.hdrs.iter().peekable();\n        while let Some(h) = req_hdrs.next() {\n            writeln!(out, \"        {{\").unwrap();","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/apps/src/common.rs#L142-L178","documentation":"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.","triggerScenarios":"Enabling qlog (e.g. --qlog-dir or connect() with qlog options) where filename/path points into a non-existent or unwritable directory.","commonSituations":"Wrong --qlog-dir path, missing directory, read-only container filesystem, or insufficient permissions when running as a non-root user.","solutions":["Ensure the qlog output directory exists and is writable (mkdir -p).","Verify the path in the error message is what you intended.","Check filesystem permissions or free space.","Disable qlog if tracing is not needed."],"exampleFix":"// before\nquiche-client --qlog-dir /var/qlog https://example.org:4433\n// after\nmkdir -p /var/qlog && quiche-client --qlog-dir /var/qlog https://example.org:4433","handlingStrategy":"validation","validationCode":"let qlog_dir = std::path::Path::new(\"/var/qlog\");\nstd::fs::create_dir_all(qlog_dir).expect(\"cannot create qlog dir\");\nassert!(qlog_dir.is_dir());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["mkdir -p the qlog directory before enabling qlog.","Use a path under your home or a writable volume when running unprivileged.","Disable qlog in production if not needed."],"tags":["filesystem","qlog","io"],"backgroundTag":"file-open-failed","analyzedSha":"9f96daa2c22a4468b0036fb0a0a3894eee6498b8","analyzedAt":"2026-09-08T11:27:09.536Z","contentChangedAt":"2026-09-08T11:27:09.536Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}