{"record":{"id":"0ec95b063a67b64b","repo":"EpicGames/lore","slug":"no-handshake-data","errorCode":null,"errorMessage":"No handshake data","messagePattern":"No handshake data","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lore-server/src/quic/quinn/quinn_server.rs","lineNumber":255,"sourceCode":"                                }\n                                .in_current_span(),\n                            )\n                        );\n                    }\n                }\n                .in_current_span(),\n            )\n        );\n    }\n\n    Ok(())\n}\n\nfn get_protocol(connection: &quinn::Connection) -> Result<String, anyhow::Error> {\n    let handshake_data = connection\n        .handshake_data()\n        .and_then(|h| h.downcast::<HandshakeData>().ok())\n        .ok_or(anyhow!(\"No handshake data\"))?;\n\n    handshake_data\n        .protocol\n        .map(String::from_utf8)\n        .transpose()\n        .map_err(|e| anyhow!(\"Failed to decode protocol: {e:?}\"))?\n        .ok_or(anyhow!(\"No protocol found on request\"))\n}\n\n#[tracing::instrument(\n    name = \"urc-quic\",\n    skip_all,\n    fields(connection_id, protocol, correlation_id, repository_id)\n)]\nasync fn handle_conn(\n    conn: quinn::Incoming,\n    monitor: TaskMonitor,\n    connection_metrics_interval: Duration,","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/quic/quinn/quinn_server.rs#L237-L273","documentation":"After a QUIC connection is established, the server reads handshake data to learn the negotiated ALPN protocol. quinn's handshake_data() returns None before the handshake completes or if the data cannot be downcast to the expected HandshakeData type; get_protocol then fails with this error.","triggerScenarios":"A client connection is accepted but handshake_data() is still None (handshake not finished) or the downcast to HandshakeData fails; handle_conn then aborts the connection.","commonSituations":"Race where the connection is polled before handshake completion; quinn version change altering the handshake data box type so downcast fails; client disconnecting mid-handshake.","solutions":["Wait for the connection to become established (connect()/accept() already yields connected conns — verify you are not using an early events API) before reading handshake data","Ensure the downcast target matches the quinn crate version's HandshakeData type used when building TLS config","Log connection state and retry/handle gracefully instead of failing hard"],"exampleFix":"// before\nlet data = connection.handshake_data().ok_or(anyhow!(\"No handshake data\"))?;\n// after\nmatch connection.handshake_data().and_then(|h| h.downcast::<HandshakeData>().ok()) {\n    Some(h) => /* use h.protocol */,\n    None => { warn!(\"handshake data unavailable; dropping conn\"); return Ok(()); }\n}","handlingStrategy":"try-catch","validationCode":"if connection.handshake_data().is_none() {\n    // handshake not complete yet; wait or drop\n}","typeGuard":"fn handshake_protocol(conn: &quinn::Connection) -> Option<String> {\n    conn.handshake_data()?.downcast::<HandshakeData>().ok()?.protocol.clone().map(|b| String::from_utf8_lossy(&b).into_owned())\n}","tryCatchPattern":"match get_protocol(&connection) {\n    Err(e) if e.to_string().contains(\"No handshake data\") => {\n        warn!(\"handshake data missing; closing connection gracefully\");\n        return Ok(());\n    }\n    r => r?,\n}","preventionTips":["Pin and track quinn crate versions; downcast targets can change between versions","Treat handshake-data absence as a normal disconnect case, not a fatal error","Avoid racing the connection state; only inspect after accept()/connect() resolves"],"tags":["rust","quic","tls","handshake"],"backgroundTag":"unexpected-response-shape","analyzedSha":"074eb0b0d1194c997d7cf28b55519e3e197b3e23","analyzedAt":"2026-09-13T09:00:57.509Z","contentChangedAt":"2026-09-13T09:00:57.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}