Morganamilo/paru · error · anyhow::Error

get

Error message

get {}: {}

What it means

list_aur fetches the AUR RPC metadata over HTTP and fails when the GET request cannot be sent (network/DNS error, surfaced via with_context) or when the server returns a non-success status. The message 'get {}: {}' carries the URL and the HTTP status or transport error. It guards the rest of the sync pipeline, which assumes a fully downloaded, gunzipped response body.

Solutions

  1. Check connectivity to https://aur.archlinux.org/rpc/v5/info?arg[]=paru (curl -v) and fix network/proxy.
  2. Retry later if the AUR is down or rate-limiting (wait, back off).
  3. Verify the aur_url setting in paru.conf if customized; reset to https://aur.archlinux.org/.
  4. Update paru; older versions can hit changed RPC endpoints.

Example fix

// before
let resp = client.get(url.clone()).send().await?;
// after
let resp = client.get(url.clone()).send().await
    .with_context(|| format!("get {}", url))?;
ensure!(resp.status().is_success(), "get {}: {}", url, resp.status());
Defensive patterns

Strategy: retry

Validate before calling

curl -fsS 'https://aur.archlinux.org/rpc/v5/info?arg[]=paru' >/dev/null && echo ok

Try / catch

match paru's exit status; on network/http errors, retry with exponential backoff before giving up

Prevention

When it happens

Trigger: Calling list (which calls list_aur) when the AUR RPC endpoint (https://aur.archlinux.org/rpc) is unreachable, DNS fails, TLS fails, or the server replies 4xx/5xx (rate limit, maintenance, captive portal).

Common situations: No internet connection or behind a proxy/captive portal; AUR website outage or maintenance window; mirrored/patched aur_url in paru.conf pointing at a dead host; aggressive request rate triggering 429.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of Morganamilo/paru@9ac3578807 (2026-09-12). Data as JSON: /api/errors/7117ad136990676c. Report an issue: GitHub.

Appendix: source

Thrown at src/sync.rs:106

                    name.as_bytes(),
                    &repo.name,
                    &pkg.srcinfo.version(),
                )
            }
        }
    }
}

pub async fn list_aur(config: &Config) -> Result<()> {
    let url = config.aur_url.join("packages.gz")?;
    let client = config.raur.client();
    let resp = client
        .get(url.clone())
        .send()
        .await
        .with_context(|| format!("get {}", url))?;
    let success = resp.status().is_success();
    ensure!(success, "get {}: {}", url, resp.status());

    let data = resp.bytes().await?;
    let mut decoder = GzDecoder::new(&*data);
    let mut data = Vec::new();
    decoder
        .read_to_end(&mut data)
        .with_context(|| tr!("failed to decode package list"))?;

    let stdout = std::io::stdout();
    let mut stdout = stdout.lock();

    for line in data.split(|b| *b == b'\n').filter(|l| !l.is_empty()) {
        print_pkg(config, &mut stdout, line, "aur", "unknown-version");
    }

    Ok(())
}

View on GitHub (pinned to 9ac3578807)