{"record":{"id":"bd84623f1003b4f2","repo":"rtk-ai/rtk","slug":"no-telemetry-endpoint-configured","errorCode":null,"errorMessage":"no telemetry endpoint configured","messagePattern":"no telemetry endpoint configured","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/telemetry_cmd.rs","lineNumber":179,"sourceCode":"                println!(\"Erasure request sent to server.\");\n            }\n            Err(e) => {\n                eprintln!(\"rtk: could not reach server: {}\", e);\n                eprintln!(\"  To complete erasure, email contact@rtk-ai.app\");\n                eprintln!(\"  with your device hash: {}\", hash);\n            }\n        }\n    }\n\n    println!(\"Local telemetry data deleted. Telemetry disabled.\");\n    Ok(())\n}\n\nfn send_erasure_request(device_hash: &str) -> Result<()> {\n    let url = option_env!(\"RTK_TELEMETRY_URL\");\n    let url = match url {\n        Some(u) => format!(\"{}/erasure\", u),\n        None => anyhow::bail!(\"no telemetry endpoint configured\"),\n    };\n\n    let payload = serde_json::json!({\n        \"device_hash\": device_hash,\n        \"action\": \"erasure\",\n    });\n\n    let mut req = ureq::post(&url).set(\"Content-Type\", \"application/json\");\n\n    if let Some(token) = option_env!(\"RTK_TELEMETRY_TOKEN\") {\n        req = req.set(\"X-RTK-Token\", token);\n    }\n\n    req.timeout(std::time::Duration::from_secs(5))\n        .send_string(&payload.to_string())?;\n\n    Ok(())\n}","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/rtk-ai/rtk/blob/d977e1c31621fe8704e6500ceeb9c7a0de2b6836/src/core/telemetry_cmd.rs#L161-L197","documentation":"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.","triggerScenarios":"`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.","commonSituations":"Users of distro/homebrew/cargo installs running erasure; forks built from source without the env var; CI builds of downstream packaging.","solutions":["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","Maintainers/custom builds: rebuild with the endpoint: `RTK_TELEMETRY_URL=https://telemetry.example cargo build --release` (optionally RTK_TELEMETRY_TOKEN)","When packaging rtk, decide up front whether the build ships an erasure endpoint; document it either way"],"exampleFix":"# before (user side): standard build, no endpoint baked in\nrtk telemetry erase\n# rtk: could not reach server: no telemetry endpoint configured\n#   To complete erasure, email contact@rtk-ai.app with your device hash: ...\n# (local salt/marker/tracking DB were still deleted — exit is Ok)\n\n# after (maintainer side): bake the endpoint at build time\nRTK_TELEMETRY_URL=https://telemetry.example.org cargo build --release","handlingStrategy":"fallback","validationCode":"bash (maintainer, pre-build):\n# erasure endpoint is compile-time only — verify it before building\n[ -n \"$RTK_TELEMETRY_URL\" ] || echo \"warning: build will not support remote erasure\" >&2\ncargo build --release","typeGuard":null,"tryCatchPattern":"rust (this is exactly the shipped caller pattern at telemetry_cmd.rs:159-168 — keep it):\nif let Some(hash) = device_hash {\n    if let Err(e) = send_erasure_request(&hash) {\n        eprintln!(\"rtk: could not reach server: {e}\");\n        eprintln!(\"  To complete erasure, email contact@rtk-ai.app\");\n        eprintln!(\"  with your device hash: {hash}\");\n    }\n}\n// local deletion already succeeded; still return Ok(())","preventionTips":["Expect standard builds to lack an erasure endpoint — the email fallback is the supported path","option_env! is compile-time: no runtime env var can add the endpoint after build","Local erasure (salt, marker, tracking DB) completes before the network attempt — verify locally if in doubt","When packaging rtk, document whether your build ships RTK_TELEMETRY_URL"],"tags":["telemetry","build-config","compile-time","gdpr","erasure"],"backgroundTag":null,"analyzedSha":"d977e1c31621fe8704e6500ceeb9c7a0de2b6836","analyzedAt":"2026-08-16T05:40:46.291Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}