{"record":{"id":"0423b8d2ed4fe0e2","repo":"denisidoro/navi","slug":"navi-was-unable-to-call-wget-make-sure-wget-is-co","errorCode":null,"errorMessage":"navi was unable to call wget.\nMake sure wget is correctly installed.","messagePattern":"navi was unable to call wget\\.\nMake sure wget is correctly installed\\.","errorType":"exception","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"src/clients/cheatsh.rs","lineNumber":32,"sourceCode":"    .map(map_line)\n    .collect()\n}\n\npub fn call(query: &str) -> Result<Vec<String>> {\n    let args = [\"-qO-\", &format!(\"cheat.sh/{query}\")];\n\n    let child = Command::new(\"wget\")\n        .args(args)\n        .stdin(Stdio::piped())\n        .stdout(Stdio::piped())\n        .spawn();\n\n    let child = match child {\n        Ok(x) => x,\n        Err(_) => {\n            let msg = \"navi was unable to call wget.\nMake sure wget is correctly installed.\";\n            return Err(anyhow!(msg));\n        }\n    };\n\n    let out = child.wait_with_output().context(\"Failed to wait for wget\")?;\n\n    if let Some(0) = out.status.code() {\n        let stdout = out.stdout;\n        let plain_bytes = strip_ansi_escapes::strip(stdout);\n\n        let markdown = String::from_utf8(plain_bytes).context(\"Output is invalid utf8\")?;\n        if markdown.starts_with(\"Unknown topic.\") {\n            let msg = format!(\n                \"`{}` not found in cheatsh.\nOutput:\n{}\n\",\n                &query, markdown,\n            );","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/denisidoro/navi/blob/f7330b9ad5bd95b7d1a3c96d00e0a77deb589147/src/clients/cheatsh.rs#L14-L50","documentation":"`clients::cheatsh::call` spawns `wget` to fetch a cheatsheet from the cheat.sh service. If the process cannot be spawned at all (IO error from Command::spawn), navi returns `anyhow!(\"navi was unable to call wget. Make sure wget is correctly installed.\")`. It signals a missing/unusable wget binary on the host.","triggerScenarios":"Using `navi` with the cheat.sh client when `Command::new(\"wget\")...spawn()` returns Err: wget is not installed, not on PATH, or lacks execute permission.","commonSituations":"Fresh containers/minimal distros without wget, PATH missing /usr/bin in cron or GUI-launched contexts, corrupted wget install, or users who only have curl installed.","solutions":["Install wget (apt install wget / brew install wget / apk add wget)","Verify with `which wget && wget --version` that it's on PATH","Switch navi's cheatsheet source to a local directory or another client that doesn't need wget","If wget exists but is unreachable, fix your PATH environment"],"exampleFix":"// before\n$ navi cheatsheet some-query\nError: navi was unable to call wget.\n// after\n$ sudo apt-get install -y wget\n$ which wget\n/usr/bin/wget\n$ navi cheatsheet some-query","handlingStrategy":"validation","validationCode":"use std::process::Command;\nfn wget_available() -> bool {\n    Command::new(\"wget\").arg(\"--version\").output()\n        .map(|o| o.status.success()).unwrap_or(false)\n}\nif !wget_available() {\n    eprintln!(\"install wget before using the cheat.sh client\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"match navi::clients::cheatsh::call(query, opts) {\n    Ok(lines) => render(lines),\n    Err(e) if e.to_string().contains(\"unable to call wget\") => {\n        eprintln!(\"wget missing: install it with your package manager\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Install wget in containers/images that run navi","Check `which wget` when PATH is customized","Prefer local cheatsheets when offline","Alias/link curl setups only if you also handle wget-based paths"],"tags":["network","wget","missing-binary","cheat-sh"],"backgroundTag":"missing-binary-dependency","analyzedSha":"f7330b9ad5bd95b7d1a3c96d00e0a77deb589147","analyzedAt":"2026-09-03T13:58:22.429Z","contentChangedAt":"2026-09-03T13:58:22.429Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}