{"record":{"id":"c5293860bc2776a3","repo":"EpicGames/lore","slug":"received-connection-for-unsupported-protocol-protocol","errorCode":null,"errorMessage":"Received connection for unsupported protocol: {protocol:?}","messagePattern":"Received connection for unsupported protocol: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lore-server/src/quic/quinn/quinn_server.rs","lineNumber":295,"sourceCode":"\n    let protocol = get_protocol(&connection)?;\n\n    let connection_id = connection.stable_id();\n\n    let conn_span = tracing::Span::current();\n    conn_span.record(\"connection_id\", connection_id);\n    conn_span.record(\"protocol\", &protocol);\n\n    info!(\n        remote_address = %connection.remote_address(),\n        \"Established connection\",\n    );\n\n    let Some((service_name, service_builder)) =\n        stream_handler_factory.get_stream_handler_builder(&protocol)\n    else {\n        warn!(\"Protocol {protocol} is not supported by the stream handler factory\");\n        return Err(anyhow!(\n            \"Received connection for unsupported protocol: {protocol:?}\"\n        ));\n    };\n\n    let _stats_guard =\n        track_connection_stats(service_name, &connection, connection_metrics_interval);\n\n    let context = Arc::new(AttributeMap::default());\n    context.insert(conn_span.clone());\n    context.insert(ConnectionId(connection_id));\n\n    // Create the stream handler once per connection so per-connection state\n    // (e.g. SessionMap in StorageServiceV4) is shared across all streams.\n    let connection_handler: Arc<Box<dyn StreamDataHandler>> =\n        Arc::new(service_builder(context.clone()));\n\n    // Keeps accepting requests until the connection closes or errors\n    loop {","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/quic/quinn/quinn_server.rs#L277-L313","documentation":"A guard in handle_conn: the client negotiated a valid ALPN protocol, but that protocol string is not registered in the stream handler factory, so no service/stream-handler builder exists for it. It fires when a client speaks a protocol this server build does not support (e.g. an outdated or mismatched client), and the connection is dropped with a warning.","triggerScenarios":"Client negotiates a protocol (via ALPN) that the server's stream_handler_factory has no handler registered for — get_stream_handler_builder(&protocol) returns None.","commonSituations":"Client updated to a newer protocol version the server hasn't deployed; server started with feature flags that omit a service; typo/divergence in protocol strings between client and server.","solutions":["Register a handler for the protocol in the stream handler factory, or update the client to use a protocol the server supports","Align protocol version strings between client and server deployments","Check server feature flags/config that gate service registration"],"exampleFix":"// before\nfactory.register(\"lore/1\", handler);\n// after\nfactory.register(\"lore/1\", handler).register(\"lore/2\", handler_v2);","handlingStrategy":"validation","validationCode":"// client side: verify protocol is supported before connecting\nlet supported = advertised_protocols(); // fetched or hardcoded per deployment\nassert!(supported.contains(\"lore/1\"), \"protocol not supported by server\");","typeGuard":null,"tryCatchPattern":"if let Err(e) = handle_conn(&connection, &factory).await {\n    if e.to_string().contains(\"unsupported protocol\") {\n        warn!(\"client used unsupported protocol; closing gracefully\");\n        return Ok(());\n    }\n    return Err(e);\n}","preventionTips":["Coordinate protocol version rollouts between client and server","Gate handler registration on explicit config, not just feature flags","Log negotiated protocols to spot mismatches early"],"tags":["rust","quic","alpn","routing"],"backgroundTag":"unsupported-operation","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"}