{"record":{"id":"fc9a05cad43d74e4","repo":"EpicGames/lore","slug":"failed-to-create-client-endpoint","errorCode":null,"errorMessage":"Failed to create client endpoint","messagePattern":"Failed to create client endpoint","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lore-server/src/quic/stream_handler.rs","lineNumber":897,"sourceCode":"                .pkey_file(key_path)\n                .stream_handler_factory(factory)\n                .build()\n                .unwrap(),\n        )\n        .expect(\"Failed Quinn server start\");\n\n        let mut crypto_config = rustls::ClientConfig::builder()\n            .dangerous()\n            .with_custom_certificate_verifier(insecure_client_auth::SkipServerVerification::new())\n            .with_no_client_auth();\n        crypto_config.alpn_protocols = vec![protocol.as_bytes().into()];\n\n        let client_config = ClientConfig::new(Arc::new(\n            QuicClientConfig::try_from(crypto_config).expect(\"Failed client config\"),\n        ));\n\n        let client_addr: SocketAddr = \"0.0.0.0:0\".parse().unwrap();\n        let mut endpoint = Endpoint::client(client_addr).expect(\"Failed to create client endpoint\");\n        endpoint.set_default_client_config(client_config);\n\n        let connection = endpoint\n            .connect(server_addr, \"localhost\")\n            .unwrap()\n            .await\n            .unwrap();\n        let (send, recv) = connection\n            .open_bi()\n            .await\n            .expect(\"Failed to setup bidirectional channel\");\n\n        Harness {\n            send,\n            recv,\n            connection,\n            _server: server,\n            _endpoint: endpoint,","sourceCodeStart":879,"sourceCodeEnd":915,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/quic/stream_handler.rs#L879-L915","documentation":"Endpoint::client(client_addr) panics here when quinn cannot create the client UDP endpoint. It fails if the local SocketAddr cannot be bound (invalid address, port in use, or no UDP capability in the environment).","triggerScenarios":"Binding to \"0.0.0.0:0\" fails due to sandbox/IPv6-vs-IPv4 mismatch, UDP blocked in the container, or the address family unsupported by the host.","commonSituations":"CI containers without UDP socket permissions; using [::]:0 on a host with IPv6 disabled; conflicting network namespaces in tests.","solutions":["Inspect the underlying io::Error from Endpoint::client (permission denied vs address invalid)","Fall back to 127.0.0.1:0 when 0.0.0.0:0 is blocked in the environment","Verify the environment allows UDP sockets (Docker seccomp, CI sandbox policies)","Match address family to the server's (IPv4 server_addr with IPv4 client bind)"],"exampleFix":"// before\nlet mut endpoint = Endpoint::client(client_addr).expect(\"Failed to create client endpoint\");\n// after\nlet mut endpoint = Endpoint::client(client_addr)\n    .unwrap_or_else(|e| panic!(\"Failed to create client endpoint {client_addr}: {e}\"));","handlingStrategy":"validation","validationCode":"let client_addr: std::net::SocketAddr = \"0.0.0.0:0\".parse().unwrap();\nassert!(std::net::UdpSocket::bind(client_addr).is_ok(), \"UDP bind unavailable for client endpoint\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 127.0.0.1:0 as fallback when 0.0.0.0 is blocked in CI/sandboxes","Match client/server address families","Confirm UDP is permitted in the container/seccomp profile"],"tags":["quic","network","udp","rust","test-harness"],"backgroundTag":"address-already-in-use","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"}