{"record":{"id":"6a54075116bb447e","repo":"Morganamilo/paru","slug":"get-search","errorCode":null,"errorMessage":"get {}: {}","messagePattern":"get \\{\\}: \\{\\}","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/search.rs","lineNumber":174,"sourceCode":"        if !matches!(pkgs, Err(raur::Error::Aur(_))) {\n            break;\n        }\n    }\n\n    if pkgs.is_ok() {\n        targets.remove(index);\n    }\n\n    Ok(pkgs?)\n}\n\nasync fn search_aur_regex(config: &Config, targets: &[String]) -> Result<Vec<raur::Package>> {\n    let url = config.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    let regex = RegexSet::new(targets)?;\n\n    let pkgs = data\n        .lines()\n        .filter(|pkg| regex.is_match(pkg))\n        .collect::<Vec<_>>();\n    ensure!(pkgs.len() < 2000, \"too many packages\");\n    let pkgs = config.raur.info(&pkgs).await?;\n    Ok(pkgs)\n}\n\nasync fn search_aur(config: &Config, targets: &[String]) -> Result<Vec<raur::Package>> {","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/search.rs#L156-L192","documentation":"search_aur_regex downloads the full AUR package list (packages.gz) and fails if the HTTP response is not a success status, formatting the error as 'get <url>: <status>'. It is a defensive check that the AUR metadata download succeeded before parsing.","triggerScenarios":"Calling paru search (regex search path) when the AUR server returns 4xx/5xx for config.aur_url + 'packages.gz' — server outage, maintenance, rate limiting, or a wrong aur_url in config.","commonSituations":"AUR downtime or CDN errors; corporate proxy returning error pages; aur_url misconfigured to a mirror that no longer serves packages.gz; captive portal networks.","solutions":["Check AUR status (status.archlinux.org) and retry later if the AUR is down","Verify aur_url in paru.conf points to https://aur.archlinux.org","Test manually: curl -I <aur_url>/packages.gz to see the actual status; fix proxy/network if it's a gateway error","Check whether a proxy/firewall is intercepting the request"],"exampleFix":"// before (paru.conf)\nAurUrl = https://aur.example.org\n// after\nAurUrl = https://aur.archlinux.org","handlingStrategy":"retry","validationCode":"// pre-check AUR reachability before searching\ncurl -fsSI https://aur.archlinux.org/packages.gz >/dev/null && echo \"AUR reachable\"","typeGuard":null,"tryCatchPattern":"match paru_search(targets).await {\n    Err(e) if e.to_string().contains(\"get \") => {\n        eprintln!(\"AUR unavailable ({}), retrying later\", e);\n    }\n    Err(e) => eprintln!(\"search failed: {}\", e),\n    Ok(p) => print(p),\n}","preventionTips":["Monitor status.archlinux.org for AUR outages","Keep AurUrl at the official default","Check proxies/VPNs that may return error pages for the request"],"tags":["network","http","aur","search"],"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"}