{"record":{"id":"d5f21920dae7779d","repo":"EpicGames/lore","slug":"address-was-not-set","errorCode":null,"errorMessage":"Address was not set","messagePattern":"Address was not set","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lore-server/src/quic/quinn/config.rs","lineNumber":202,"sourceCode":"        self.transport_rtt = Some(rtt);\n        self\n    }\n\n    pub fn build(self) -> anyhow::Result<QuinnConfig> {\n        let stream_handler_factory = self\n            .stream_handler_factory\n            .ok_or(anyhow!(\"Stream handler factory was not set\"))?;\n\n        let alpns = stream_handler_factory.supported_protocols();\n        if alpns.is_empty() {\n            return Err(anyhow!(\"No alpns provided\"));\n        };\n\n        // A caller-bound socket is the truth about where this serves; asking it beats trusting an\n        // `address` set alongside it, which could disagree.\n        let address = match &self.socket {\n            Some(socket) => socket.local_addr()?,\n            None => self.address.ok_or(anyhow!(\"Address was not set\"))?,\n        };\n\n        Ok(QuinnConfig {\n            server_metrics_name: self.server_metrics_name,\n            address,\n            socket: self.socket,\n            alpns,\n            cert_file: self.cert_file,\n            pkey_file: self.pkey_file,\n            cert_chain: self.cert_chain,\n            client_cert_verifier: self\n                .client_cert_verifier\n                .unwrap_or(Arc::new(NoClientAuth {})),\n            stream_handler_factory,\n            idle_timeout: self\n                .idle_timeout\n                .unwrap_or(Duration::from_millis(DEFAULT_IDLE_TIMEOUT_MILLIS)),\n            keep_alive: self","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/quic/quinn/config.rs#L184-L220","documentation":"The builder needs a listen address: either a caller-bound UdpSocket (whose local_addr is used) or an explicit address field. If neither is set, build() cannot produce a QuinnConfig and returns this error.","triggerScenarios":"Calling QuinnConfigBuilder::build() with no socket bound and no address set via the builder; both self.socket and self.address are None.","commonSituations":"Forgetting the .address(...) builder call after a refactor; config missing the listen address and no pre-bound socket supplied (e.g. socket-activation paths).","solutions":["Call .address(addr) with the listen SocketAddr before build()","Or bind a UdpSocket and pass it via the socket setter so local_addr can be used","Ensure the config file's listen address is parsed and forwarded to the builder"],"exampleFix":"// before\nlet cfg = QuinnConfigBuilder::new().stream_handler_factory(f).build()?;\n// after\nlet cfg = QuinnConfigBuilder::new().stream_handler_factory(f).address(\"0.0.0.0:443\".parse()?).build()?;","handlingStrategy":"validation","validationCode":"if socket.is_none() && address.is_none() {\n    return Err(\"QUIC listen address must be provided (socket or address)\".into());\n}","typeGuard":null,"tryCatchPattern":"match cfg.build() {\n    Err(e) if e.to_string().contains(\"Address was not set\") => eprintln!(\"set .address(...) or bind a socket before build\"),\n    r => r?,\n}","preventionTips":["Pass the listen address from parsed config into the builder explicitly","Test server launch with the real production config in CI"],"tags":["rust","quic","builder-pattern"],"backgroundTag":"missing-required-option","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"}