{"record":{"id":"a86d564f7fa36044","repo":"rathole-org/rathole","slug":"missing-noise-config","errorCode":null,"errorMessage":"Missing noise config","messagePattern":"Missing noise config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/transport/noise.rs","lineNumber":45,"sourceCode":"        match &self.remote_public_key {\n            Some(x) => builder.remote_public_key(x),\n            None => builder,\n        }\n    }\n}\n\n#[async_trait]\nimpl Transport for NoiseTransport {\n    type Acceptor = TcpListener;\n    type RawStream = TcpStream;\n    type Stream = snowstorm::stream::NoiseStream<TcpStream>;\n\n    fn new(config: &TransportConfig) -> Result<Self> {\n        let tcp = TcpTransport::new(config)?;\n\n        let config = match &config.noise {\n            Some(v) => v.clone(),\n            None => return Err(anyhow!(\"Missing noise config\")),\n        };\n        let builder = Builder::new(config.pattern.parse()?);\n\n        let remote_public_key = match &config.remote_public_key {\n            Some(x) => {\n                Some(base64::decode(x).with_context(|| \"Failed to decode remote_public_key\")?)\n            }\n            None => None,\n        };\n\n        let local_private_key = match &config.local_private_key {\n            Some(x) => base64::decode(x.as_bytes())\n                .with_context(|| \"Failed to decode local_private_key\")?,\n            None => builder.generate_keypair()?.private,\n        };\n\n        let params: NoiseParams = config.pattern.parse()?;\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/rathole-org/rathole/blob/a292f7ed5402f840415fc6a53827da2f34337856/src/transport/noise.rs#L27-L63","documentation":"The noise-protocol transport requires a `[transport.noise]` section containing at least the handshake pattern and optionally a remote public key. When `config.noise` is None, the constructor in src/transport/noise.rs:45 returns this error. Without noise parameters the encrypted transport cannot build its handshake Builder.","triggerScenarios":"Choosing the noise transport while the config lacks the noise section, so `match &config.noise` falls to the None arm and returns Err.","commonSituations":"Copying a TCP-only config and switching transport type to noise without adding keys; forgetting to share/copy the remote public key section after generating a local keypair; config merge tooling dropping the noise block.","solutions":["Add a `[transport.noise]` section to the config with `pattern` (e.g. \"Noise_XK_25519_ChaChaPoly_BLAKE2\") and `remote_public_key` for the client.","Generate noise keys if you have none and place the local private key and peer's public key in the respective configs.","If you don't want encryption, switch transport type back to plain tcp instead of noise.","Cross-check key configuration against the repository's example configs (server needs its keypair; client needs server's public key)."],"exampleFix":"# before\n[transport]\ntype = \"noise\"\n\n# after\n[transport]\ntype = \"noise\"\n[transport.noise]\npattern = \"Noise_XK_25519_ChaChaPoly_BLAKE2\"\nremote_public_key = \"base64-encoded-server-public-key\"","handlingStrategy":"validation","validationCode":"let raw = std::fs::read_to_string(config_path)?;\nlet cfg: toml::Value = toml::from_str(&raw)?;\nif cfg.get(\"transport\").and_then(|t| t.get(\"noise\")).is_none() {\n    anyhow::bail!(\"noise transport selected but [transport.noise] is missing\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate and distribute noise keypairs as part of deployment tooling","Keep client (remote_public_key) and server configs in sync","Validate config before launch"],"tags":["noise","encryption","config","transport"],"backgroundTag":"missing-required-config-field","analyzedSha":"a292f7ed5402f840415fc6a53827da2f34337856","analyzedAt":"2026-09-07T09:56:55.739Z","contentChangedAt":"2026-09-07T09:56:55.739Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}