{"record":{"id":"34f2a1abb6a28649","repo":"rathole-org/rathole","slug":"no-available-data-channels","errorCode":null,"errorMessage":"No available data channels","messagePattern":"No available data channels","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/server.rs","lineNumber":687,"sourceCode":"        listen_backoff(),\n        || async { Ok(UdpSocket::bind(&bind_addr).await?) },\n        |e, duration| {\n            warn!(\"{:#}. Retry in {:?}\", e, duration);\n        },\n        &mut shutdown_rx,\n    )\n    .await\n    .with_context(|| \"Failed to listen for the service\")?;\n\n    info!(\"Listening at {}\", &bind_addr);\n\n    let cmd = bincode::serialize(&DataChannelCmd::StartForwardUdp).unwrap();\n\n    // Receive one data channel\n    let mut conn = data_ch_rx\n        .recv()\n        .await\n        .ok_or_else(|| anyhow!(\"No available data channels\"))?;\n    write_and_flush(&mut conn, &cmd).await?;\n\n    let mut buf = [0u8; UDP_BUFFER_SIZE];\n    loop {\n        tokio::select! {\n            // Forward inbound traffic to the client\n            val = l.recv_from(&mut buf) => {\n                let (n, from) = val?;\n                UdpTraffic::write_slice(&mut conn, from, &buf[..n]).await?;\n            },\n\n            // Forward outbound traffic from the client to the visitor\n            hdr_len = conn.read_u8() => {\n                let t = UdpTraffic::read(&mut conn, hdr_len?).await?;\n                l.send_to(&t.data, t.from).await?;\n            }\n\n            _ = shutdown_rx.recv() => {","sourceCodeStart":669,"sourceCodeEnd":705,"githubUrl":"https://github.com/rathole-org/rathole/blob/a292f7ed5402f840415fc6a53827da2f34337856/src/server.rs#L669-L705","documentation":"run_udp_connection_pool pulls a ready data channel from an internal mpsc channel to forward UDP traffic. If the channel is closed (all senders dropped) or empty when `recv().await` completes, it means no data channels were established, so UDP forwarding cannot proceed and the error is raised at src/server.rs:687.","triggerScenarios":"A UDP session is requested on the server but the pool's data_ch_rx receiver yields None — typically because no client-side data channels connected yet, or all data channel tasks exited/closed the channel.","commonSituations":"Client disconnected while a UDP session (e.g. DNS forwarding) is still active; network interruption killed all data channel connections; server started but no client ever established the data channel pool; firewall/NAT blocking the data channel connections.","solutions":["Ensure the client is running and successfully establishes data channels before/in tandem with UDP traffic.","Check logs on the client side for data-channel connection failures (TLS/noise/websocket handshake errors).","Verify network/firewall rules allow the data channel connections between client and server.","Reconnect the client or restart the UDP session so the pool gets a fresh data channel."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run_udp_connection_pool(...).await {\n    Err(e) if e.to_string().contains(\"No available data channels\") => {\n        warn!(\"data channel pool empty; retrying after reconnect\");\n        tokio::time::sleep(Duration::from_secs(2)).await;\n        // re-establish data channels then retry\n    }\n    other => other?,\n}","preventionTips":["Ensure the client maintains enough data channels before opening UDP sessions","Add health checks that data channels are alive","Handle client disconnects by tearing down dependent UDP sessions"],"tags":["udp","data-channel","network","pool"],"backgroundTag":"empty-result-set","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"}