{"record":{"id":"d7dbb58776365b9c","repo":"denisidoro/navi","slug":"failed-to-call-wget-output-error","errorCode":null,"errorMessage":"Failed to call:\nwget {}\n\nOutput:\n{}\n\nError:\n{}\n","messagePattern":"Failed to call:\nwget (.+?)\n\nOutput:\n(.+?)\n\nError:\n(.+?)\n","errorType":"exception","errorClass":"anyhow","httpStatus":null,"severity":"error","filePath":"src/clients/cheatsh.rs","lineNumber":71,"sourceCode":"\n        let lines = as_lines(query, &markdown);\n        Ok(lines)\n    } else {\n        let msg = format!(\n            \"Failed to call:\nwget {}\n\nOutput:\n{}\n\nError:\n{}\n\",\n            args.join(\" \"),\n            String::from_utf8(out.stdout).unwrap_or_else(|_e| \"Unable to get output message\".to_string()),\n            String::from_utf8(out.stderr).unwrap_or_else(|_e| \"Unable to get error message\".to_string())\n        );\n        Err(anyhow!(msg))\n    }\n}\n","sourceCodeStart":53,"sourceCodeEnd":74,"githubUrl":"https://github.com/denisidoro/navi/blob/f7330b9ad5bd95b7d1a3c96d00e0a77deb589147/src/clients/cheatsh.rs#L53-L74","documentation":"When the wget child process spawned by `cheatsh::call` exits with a non-zero status, navi returns an error containing the full wget command line plus its stdout and stderr. This distinguishes transport-level failures (DNS, TLS, HTTP errors) from 'topic not found'.","triggerScenarios":"`call` -> wget exits non-zero: no network connection, DNS failure, TLS/proxy errors, HTTP 5xx from cheat.sh, or wget blocked by firewall.","commonSituations":"Working offline, corporate proxy requiring configuration (http_proxy/https_proxy), DNS misconfiguration, cheat.sh outage, or wget certificates missing (CA bundle) in minimal containers.","solutions":["Read the Output/Error sections in the message to identify the wget failure cause","Verify connectivity: `wget https://cheat.sh` manually","Configure proxy env vars (https_proxy) if behind a corporate proxy","Retry when network/cheat.sh is back, or use a local cheatsheet source instead"],"exampleFix":"// before\n$ navi cheatsh tar\nFailed to call:\nwget https://cheat.sh/tar\nError:\nwget: unable to resolve host address 'cheat.sh'\n// after\n$ ping cheat.sh        # fix DNS/network first\n$ navi cheatsh tar","handlingStrategy":"retry","validationCode":"fn connectivity_ok() -> bool {\n    std::process::Command::new(\"wget\").args([\"-q\", \"--spider\", \"https://cheat.sh\"])\n        .status().map(|s| s.success()).unwrap_or(false)\n}\nif !connectivity_ok() {\n    eprintln!(\"no connectivity to cheat.sh; check network/proxy/DNS\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"match cheatsh::call(query, opts) {\n    Ok(lines) => render(lines),\n    Err(e) if e.to_string().contains(\"Failed to call\") => {\n        eprintln!(\"wget failed; inspect embedded stdout/stderr, retrying once...\");\n        match cheatsh::call(query, opts) { Ok(l) => render(l), Err(e2) => eprintln!(\"{}\", e2) }\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Configure http_proxy/https_proxy behind corporate proxies","Ensure CA certificates are installed in minimal images","Add DNS/network checks before remote lookups","Cache or mirror cheatsheets for offline resilience"],"tags":["network","wget","http","exit-code"],"backgroundTag":"http-request-failed","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"}