rtk-ai/rtk · warning

no telemetry endpoint configured

Error message

no telemetry endpoint configured

What it means

send_erasure_request posts a GDPR erasure payload to a URL baked in at COMPILE time via option_env!("RTK_TELEMETRY_URL"). Builds made without that variable have no endpoint, so the function bails immediately. The caller catches it: local data (salt, marker, tracking DB) is already deleted first, and the command prints a fallback — email contact@rtk-ai.app with the device hash — then still reports success locally.

Source

Thrown at src/core/telemetry_cmd.rs:179

                println!("Erasure request sent to server.");
            }
            Err(e) => {
                eprintln!("rtk: could not reach server: {}", e);
                eprintln!("  To complete erasure, email contact@rtk-ai.app");
                eprintln!("  with your device hash: {}", hash);
            }
        }
    }

    println!("Local telemetry data deleted. Telemetry disabled.");
    Ok(())
}

fn send_erasure_request(device_hash: &str) -> Result<()> {
    let url = option_env!("RTK_TELEMETRY_URL");
    let url = match url {
        Some(u) => format!("{}/erasure", u),
        None => anyhow::bail!("no telemetry endpoint configured"),
    };

    let payload = serde_json::json!({
        "device_hash": device_hash,
        "action": "erasure",
    });

    let mut req = ureq::post(&url).set("Content-Type", "application/json");

    if let Some(token) = option_env!("RTK_TELEMETRY_TOKEN") {
        req = req.set("X-RTK-Token", token);
    }

    req.timeout(std::time::Duration::from_secs(5))
        .send_string(&payload.to_string())?;

    Ok(())
}

View on GitHub (pinned to d977e1c316)

Solutions

  1. No runtime fix exists — local erasure already completed; complete the remote part via the printed fallback: email contact@rtk-ai.app with your device hash
  2. Maintainers/custom builds: rebuild with the endpoint: `RTK_TELEMETRY_URL=https://telemetry.example cargo build --release` (optionally RTK_TELEMETRY_TOKEN)
  3. When packaging rtk, decide up front whether the build ships an erasure endpoint; document it either way

Example fix

# before (user side): standard build, no endpoint baked in
rtk telemetry erase
# rtk: could not reach server: no telemetry endpoint configured
#   To complete erasure, email contact@rtk-ai.app with your device hash: ...
# (local salt/marker/tracking DB were still deleted — exit is Ok)

# after (maintainer side): bake the endpoint at build time
RTK_TELEMETRY_URL=https://telemetry.example.org cargo build --release
Defensive patterns

Strategy: fallback

Validate before calling

bash (maintainer, pre-build):
# erasure endpoint is compile-time only — verify it before building
[ -n "$RTK_TELEMETRY_URL" ] || echo "warning: build will not support remote erasure" >&2
cargo build --release

Try / catch

rust (this is exactly the shipped caller pattern at telemetry_cmd.rs:159-168 — keep it):
if let Some(hash) = device_hash {
    if let Err(e) = send_erasure_request(&hash) {
        eprintln!("rtk: could not reach server: {e}");
        eprintln!("  To complete erasure, email contact@rtk-ai.app");
        eprintln!("  with your device hash: {hash}");
    }
}
// local deletion already succeeded; still return Ok(())

Prevention

When it happens

Trigger: `rtk telemetry erase` on any standard release build compiled without RTK_TELEMETRY_URL. Only custom builds (e.g. `RTK_TELEMETRY_URL=https://... cargo build --release`) carry an endpoint; there is no runtime env override because option_env! is resolved at compile time.

Common situations: Users of distro/homebrew/cargo installs running erasure; forks built from source without the env var; CI builds of downstream packaging.

Related errors


AI-assisted analysis of rtk-ai/rtk@d977e1c316 (2026-08-16). Data as JSON: /api/errors/bd84623f1003b4f2. Report an issue: GitHub.