{"record":{"id":"5e0ac41167f5b092","repo":"cloudflare/quiche","slug":"invalid-cc-frame-in-qlog-input-no-error-code","errorCode":null,"errorMessage":"invalid CC frame in qlog input, no error code","messagePattern":"invalid CC frame in qlog input, no error code","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"h3i/src/recordreplay/qlog.rs","lineNumber":431,"sourceCode":"                    QuicFrame::ConnectionClose {\n                        error_space,\n                        error_code,\n                        reason,\n                        ..\n                    } => {\n                        let is_app = matches!(\n                            error_space.as_ref().expect(\n                                \"invalid CC frame in qlog input, no error space\"\n                            ),\n                            ErrorSpace::Application\n                        );\n\n                        actions.push(Action::ConnectionClose {\n                            error: quiche::ConnectionError {\n                                is_app,\n                                // TODO: remove unwrap when https://github.com/cloudflare/quiche/issues/1731\n                                // is done\n                                error_code: error_code.expect(\"invalid CC frame in qlog input, no error code\"),\n                                reason: reason\n                                    .as_ref()\n                                    .map(|s| s.as_bytes().to_vec())\n                                    .unwrap_or_default(),\n                            },\n                        })\n                    },\n\n                    QuicFrame::Stream { stream_id, fin, .. } => {\n                        let fin = fin.unwrap_or_default();\n\n                        if fin {\n                            actions.push(Action::StreamBytes {\n                                stream_id: *stream_id,\n                                fin_stream: true,\n                                bytes: vec![],\n                                expected_result: Default::default(),\n                            });","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/cloudflare/quiche/blob/9f96daa2c22a4468b0036fb0a0a3894eee6498b8/h3i/src/recordreplay/qlog.rs#L413-L449","documentation":"When converting qlog events into h3i actions, a connection_close event without an error_code field is turned into quiche::ConnectionError, whose error_code field is mandatory. The code calls .expect() on the missing Option, panicking with this message. The comment references issue #1731 (Option should be removed upstream).","triggerScenarios":"Replaying a qlog file whose CONNECTION_CLOSE event lacks an error code — common for transport-level closes or qlogs emitted by other implementations.","commonSituations":"Replaying netlog/qlog traces from browsers or servers that omit error_code; hand-edited qlog files; older qlog drafts with optional error codes.","solutions":["Add an error_code field to the connection_close event in the qlog input.","Regenerate the qlog from a tool that always records the error code.","Default missing error codes (e.g. unwrap_or(0)) and remove the panic, per upstream issue #1731."],"exampleFix":"// before\nerror_code: error_code.expect(\"invalid CC frame in qlog input, no error code\"),\n// after\nerror_code: error_code.unwrap_or(0), // or 0x0c NO_ERROR for app closes","handlingStrategy":"validation","validationCode":"let error_code = event.error_code\n    .ok_or_else(|| anyhow!(\"connection_close event missing error_code in qlog\"))?;","typeGuard":null,"tryCatchPattern":"let error_code = match error_code {\n    Some(c) => c,\n    None => { eprintln!(\"skipping CC frame without error code\"); continue; }\n};","preventionTips":["Ensure qlog inputs record error_code on CONNECTION_CLOSE events.","Prefer regenerating traces with tools that emit complete CC frames.","Default missing codes (unwrap_or) rather than panicking; track upstream issue #1731."],"tags":["qlog","http3","parsing","panic"],"backgroundTag":"missing-required-argument","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"}