{"record":{"id":"760af622e06cfbfc","repo":"cloudflare/quiche","slug":"failed-to-open-file","errorCode":null,"errorMessage":"failed to open file","messagePattern":"failed to open file","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"h3i/src/main.rs","lineNumber":377,"sourceCode":"        )\n        .await\n        .unwrap()\n        .await\n    };\n\n    Ok(rt.block_on(fut))\n}\n\n#[cfg(not(feature = \"async\"))]\nfn sync_client(\n    config: Config, actions: Vec<Action>,\n) -> Result<ConnectionSummary, ClientError> {\n    // TODO: CLI/qlog don't support passing close trigger frames at the moment\n    h3i::client::sync_client::connect(config.library_config, actions, None)\n}\n\nfn read_qlog(filename: &str, host_override: Option<&str>) -> Vec<Action> {\n    let file = std::fs::File::open(filename).expect(\"failed to open file\");\n    let reader = BufReader::new(file);\n\n    let qlog_reader = QlogSeqReader::new(Box::new(reader)).unwrap();\n    let mut actions = vec![];\n\n    for event in qlog_reader {\n        match event {\n            qlog::reader::Event::Qlog(ev) => {\n                let ac: H3Actions = actions_from_qlog(ev, host_override);\n                actions.extend(ac.0);\n            },\n\n            qlog::reader::Event::Json(ev) => {\n                let ac: H3Actions = (ev).into();\n                actions.extend(ac.0);\n            },\n        }\n    }","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/h3i/src/main.rs#L359-L395","documentation":"h3i's read_qlog opens the qlog file with std::fs::File::open and panics with this message if opening fails. It is used to replay recorded qlog events into h3i actions, so a missing or unreadable path aborts the whole run.","triggerScenarios":"Passing a --qlog-input filename that does not exist, is a directory, or is not readable by the current user.","commonSituations":"Typoed path; qlog file written to another directory; running in a container without the file mounted; permission issues after a sudo-generated qlog.","solutions":["Verify the qlog file path exists and is readable (ls -l <file>).","Pass the correct absolute path to the qlog input file.","Fix file permissions (chmod/chown) or run from the directory containing the qlog."],"exampleFix":"// before\nh3i --qlog-input qlog/trace.qlog\n// after (verify first)\nls -l qlog/trace.qlog && h3i --qlog-input ./qlog/trace.qlog","handlingStrategy":"validation","validationCode":"use std::path::Path;\nif !Path::new(filename).is_file() {\n    eprintln!(\"qlog input not found: {filename}\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"std::fs::File::open(filename)\n    .map_err(|e| { eprintln!(\"failed to open qlog {filename}: {e}\"); std::process::exit(1); })","preventionTips":["Check file existence/permissions before invoking h3i.","Use absolute paths for qlog inputs.","Mount qlog files into containers explicitly."],"tags":["file-io","qlog","panic"],"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-16T04:17:20.429Z"}