{"record":{"id":"f644d0dd1b06dbb2","repo":"rathole-org/rathole","slug":"try-to-run-as-a-client-but-the-configuration-is-m","errorCode":null,"errorMessage":"Try to run as a client, but the configuration is missing. Please add the `[client]` block","messagePattern":"Try to run as a client, but the configuration is missing\\. Please add the `\\[client\\]` block","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/client.rs","lineNumber":40,"sourceCode":"use tracing::{debug, error, info, instrument, trace, warn, Instrument, Span};\n\n#[cfg(feature = \"noise\")]\nuse crate::transport::NoiseTransport;\n#[cfg(any(feature = \"native-tls\", feature = \"rustls\"))]\nuse crate::transport::TlsTransport;\n#[cfg(any(feature = \"websocket-native-tls\", feature = \"websocket-rustls\"))]\nuse crate::transport::WebsocketTransport;\n\nuse crate::constants::{run_control_chan_backoff, UDP_BUFFER_SIZE, UDP_SENDQ_SIZE, UDP_TIMEOUT};\n\n// The entrypoint of running a client\npub async fn run_client(\n    config: Config,\n    shutdown_rx: broadcast::Receiver<bool>,\n    update_rx: mpsc::Receiver<ConfigChange>,\n) -> Result<()> {\n    let config = config.client.ok_or_else(|| {\n        anyhow!(\n        \"Try to run as a client, but the configuration is missing. Please add the `[client]` block\"\n    )\n    })?;\n\n    match config.transport.transport_type {\n        TransportType::Tcp => {\n            let mut client = Client::<TcpTransport>::from(config).await?;\n            client.run(shutdown_rx, update_rx).await\n        }\n        TransportType::Tls => {\n            #[cfg(any(feature = \"native-tls\", feature = \"rustls\"))]\n            {\n                let mut client = Client::<TlsTransport>::from(config).await?;\n                client.run(shutdown_rx, update_rx).await\n            }\n            #[cfg(not(any(feature = \"native-tls\", feature = \"rustls\")))]\n            crate::helper::feature_neither_compile(\"native-tls\", \"rustls\")\n        }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/rathole-org/rathole/blob/a292f7ed5402f840415fc6a53827da2f34337856/src/client.rs#L22-L58","documentation":"Fires at the start of run_client when the merged configuration has no [client] block. run_client requires client-specific settings (server address, services to forward, etc.); being invoked with a config that only contains other sections means the instance was launched in client mode without any client configuration, so it cannot proceed.","triggerScenarios":"Thrown at src/client.rs:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a [client] block (with remote server address and service mappings) to the config file","Make sure the correct config file path is being passed to the client process","If using both [client] and [server] in one binary, confirm the intended mode is selected","Validate the config before launching so this condition is reported as a config error"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}