{"record":{"id":"454dd69ed3b33d54","repo":"rathole-org/rathole","slug":"the-feature-is-not-compiled-in-this-binary-p","errorCode":null,"errorMessage":"The feature '{}' is not compiled in this binary. Please re-compile rathole","messagePattern":"The feature '(.+?)' is not compiled in this binary\\. Please re-compile rathole","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/helper.rs","lineNumber":40,"sourceCode":"    keepalive_interval: Duration,\n) -> Result<()> {\n    let s = SockRef::from(conn);\n    let keepalive = TcpKeepalive::new()\n        .with_time(keepalive_duration)\n        .with_interval(keepalive_interval);\n\n    trace!(\n        \"Set TCP keepalive {:?} {:?}\",\n        keepalive_duration,\n        keepalive_interval\n    );\n\n    Ok(s.set_tcp_keepalive(&keepalive)?)\n}\n\n#[allow(dead_code)]\npub fn feature_not_compile(feature: &str) -> ! {\n    panic!(\n        \"The feature '{}' is not compiled in this binary. Please re-compile rathole\",\n        feature\n    )\n}\n\n#[allow(dead_code)]\npub fn feature_neither_compile(feature1: &str, feature2: &str) -> ! {\n    panic!(\n        \"Neither of the feature '{}' or '{}' is compiled in this binary. Please re-compile rathole\",\n        feature1, feature2\n    )\n}\n\npub async fn to_socket_addr<A: ToSocketAddrs>(addr: A) -> Result<SocketAddr> {\n    lookup_host(addr)\n        .await?\n        .next()\n        .ok_or_else(|| anyhow!(\"Failed to lookup the host\"))","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/rathole-org/rathole/blob/a292f7ed5402f840415fc6a53827da2f34337856/src/helper.rs#L22-L58","documentation":"rathole is compiled with cargo feature flags (client, server, transports). This panic fires when code calls helper::feature_not_compile because the feature needed for the requested functionality was not enabled when the binary was built. It is a hard, unrecoverable panic indicating a build-time configuration problem, not a runtime failure.","triggerScenarios":"Calling run_client or run_server paths when the corresponding cargo feature (e.g. \"client\" or \"server\") is absent, guarded by #[cfg(not(feature = ...))] before invoking feature_not_compile.","commonSituations":"Installing rathole via a package manager or Docker image built with a minimal feature set, then trying to run it in the other mode; building with --no-default-features but forgetting to re-add needed features; downloading a slim release binary.","solutions":["Rebuild rathole with the required feature enabled, e.g. cargo build --release --features client (or server, or both)","Install a full-feature build: cargo install rathole --features client,server","Use a Docker image / release binary that includes the needed features","Check available features in Cargo.toml and confirm with the binary's mode which one you need"],"exampleFix":"// before\ncargo build --release --no-default-features --features server\n// then running the binary as a client panics\n\n// after\ncargo build --release --no-default-features --features client,server","handlingStrategy":"validation","validationCode":"// Check the binary was built with the needed feature before relying on runtime behavior.\n// rathole exposes no runtime API for this; instead verify at deploy time:\n// $ cargo metadata --no-deps --format-version 1 | jq '.packages[0].features'\n// or simply test the binary's mode at startup in a wrapper script:\n# if ! rathole --help | grep -q client; then echo 'build lacks client feature'; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always build with --features client,server unless you specifically want a slim binary","Document required features in your deployment script or Dockerfile","Prefer official full-feature release binaries over custom minimal builds"],"tags":["rust","compile-time","feature-flags","build-configuration"],"backgroundTag":"feature-not-enabled","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"}