{"record":{"id":"a9f5bdf994bde591","repo":"Morganamilo/paru","slug":"get","errorCode":null,"errorMessage":"get {}: {}","messagePattern":"get \\{\\}: \\{\\}","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/completion.rs","lineNumber":21,"sourceCode":"\nuse std::fs::{create_dir_all, metadata, remove_file, OpenOptions};\nuse std::io::{stdout, BufRead, BufReader, Read, Write};\nuse std::path::Path;\nuse std::time::{Duration, SystemTime};\n\nuse anyhow::{ensure, Context, Result};\nuse flate2::read::GzDecoder;\nuse reqwest::get;\nuse tr::tr;\nuse url::Url;\n\nasync fn save_aur_list(aur_url: &Url, cache_dir: &Path) -> Result<()> {\n    let url = aur_url.join(\"packages.gz\")?;\n    let resp = get(url.clone())\n        .await\n        .with_context(|| format!(\"get {}\", url))?;\n    let success = resp.status().is_success();\n    ensure!(success, \"get {}: {}\", url, resp.status());\n\n    let data = resp.bytes().await?;\n    let decoder = GzDecoder::new(&*data);\n    let data =\n        std::io::read_to_string(decoder).with_context(|| tr!(\"failed to decode package list\"))?;\n\n    create_dir_all(cache_dir)?;\n    let path = cache_dir.join(\"packages.aur\");\n    let file = OpenOptions::new()\n        .write(true)\n        .create(true)\n        .truncate(true)\n        .open(&path);\n    let mut file = file.with_context(|| tr!(\"failed to open cache file '{}'\", path.display()))?;\n\n    for line in data.lines().filter(|l| !l.is_empty()) {\n        file.write_all(line.as_bytes())?;\n        file.write_all(b\"\\n\")?;","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/completion.rs#L3-L39","documentation":"save_aur_list fetches the AUR package list (packages.gz) from the configured AUR URL. Two sites produce \"get {url}: {detail}\": the reqwest GET fails (context from the transport error) or the response status is not a success (ensure! with the status code). Either way the AUR list cache cannot be saved.","triggerScenarios":"Calling update_aur_cache → save_aur_list when the AUR server is unreachable, DNS fails, TLS fails, or the server returns a non-2xx status (5xx, 404, rate limit) for packages.gz.","commonSituations":"AUR outage or maintenance; DNS resolution failure behind captive portals/VPNs; proxy or firewall blocking aur.archlinux.org; stale/misconfigured AurUrl pointing at a dead mirror.","solutions":["Retry later — AUR outages are the most common cause; check https://status.archlinux.org.","Test connectivity: `curl -I https://aur.archlinux.org/packages.gz` and fix DNS/proxy if it fails.","Set a proxy for paru if behind a corporate network (https_proxy env var).","Verify the AurUrl option in paru.conf points to a valid AUR RPC/mirror endpoint."],"exampleFix":"# diagnose\ncurl -I https://aur.archlinux.org/packages.gz\n# if behind proxy, before running paru\nexport https_proxy=http://proxy.corp:8080\nparu -Syu","handlingStrategy":"retry","validationCode":"let url = \"https://aur.archlinux.org/packages.gz\";\nlet reachable = reqwest::get(url).await.map(|r| r.status().is_success()).unwrap_or(false);\nassert!(reachable, \"AUR unreachable, abort before cache update\");","typeGuard":null,"tryCatchPattern":"// retry with backoff around the AUR list fetch\nfor attempt in 0..3 {\n    match save_aur_list(&aur_url, &cache_dir).await {\n        Ok(()) => break,\n        Err(e) if attempt < 2 => tokio::time::sleep(Duration::from_secs(10 << attempt)).await,\n        Err(e) => eprintln!(\"AUR list fetch failed: {e:#}\"),\n    }\n}","preventionTips":["Check https://status.archlinux.org during AUR failures.","Configure https_proxy in restricted networks.","Verify AurUrl in paru.conf points to a live endpoint.","Fail soft: stale completion cache is usually acceptable."],"tags":["network","http","aur","completion"],"backgroundTag":"http-error-response","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}