rathole-org/rathole · error

Try to run as a client, but the configuration is missing…

Error message

Try to run as a client, but the configuration is missing. Please add the `[client]` block

What it means

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.

Solutions

  1. Add a [client] block (with remote server address and service mappings) to the config file
  2. Make sure the correct config file path is being passed to the client process
  3. If using both [client] and [server] in one binary, confirm the intended mode is selected
  4. Validate the config before launching so this condition is reported as a config error
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/client.rs:40 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rathole-org/rathole@a292f7ed54 (2026-09-07). Data as JSON: /api/errors/f644d0dd1b06dbb2. Report an issue: GitHub.

Appendix: source

Thrown at src/client.rs:40

use tracing::{debug, error, info, instrument, trace, warn, Instrument, Span};

#[cfg(feature = "noise")]
use crate::transport::NoiseTransport;
#[cfg(any(feature = "native-tls", feature = "rustls"))]
use crate::transport::TlsTransport;
#[cfg(any(feature = "websocket-native-tls", feature = "websocket-rustls"))]
use crate::transport::WebsocketTransport;

use crate::constants::{run_control_chan_backoff, UDP_BUFFER_SIZE, UDP_SENDQ_SIZE, UDP_TIMEOUT};

// The entrypoint of running a client
pub async fn run_client(
    config: Config,
    shutdown_rx: broadcast::Receiver<bool>,
    update_rx: mpsc::Receiver<ConfigChange>,
) -> Result<()> {
    let config = config.client.ok_or_else(|| {
        anyhow!(
        "Try to run as a client, but the configuration is missing. Please add the `[client]` block"
    )
    })?;

    match config.transport.transport_type {
        TransportType::Tcp => {
            let mut client = Client::<TcpTransport>::from(config).await?;
            client.run(shutdown_rx, update_rx).await
        }
        TransportType::Tls => {
            #[cfg(any(feature = "native-tls", feature = "rustls"))]
            {
                let mut client = Client::<TlsTransport>::from(config).await?;
                client.run(shutdown_rx, update_rx).await
            }
            #[cfg(not(any(feature = "native-tls", feature = "rustls")))]
            crate::helper::feature_neither_compile("native-tls", "rustls")
        }

View on GitHub (pinned to a292f7ed54)