Morganamilo/paru · error · panic

change AUR URL schema from HTTPS to SSH

Error message

change AUR URL schema from HTTPS to SSH

What it means

Same HTTPS-to-SSH URL rewrite as in config.rs, performed on the config during run2 before constructing the fetch backend. The expect panics when replacen(...).parse::<Url>() fails, i.e. the configured aur_url is not a parseable https URL. It is an invariant failure caused by an invalid user configuration.

Solutions

  1. Correct aur_url in paru.conf to a full https:// URL such as https://aur.archlinux.org/.
  2. Drop any ssh://aur@ prefix from aur_url; paru applies it automatically when Ssh = true.
  3. Set Ssh = false if you want to keep a non-https URL untouched.

Example fix

// before
AurUrl = aur.archlinux.org
// after
AurUrl = https://aur.archlinux.org/
Defensive patterns

Strategy: validation

Validate before calling

grep -E '^AurUrl' ~/.config/paru/paru.conf  # must be full https:// URL

Type guard

fn is_https_url(s: &str) -> bool { s.starts_with("https://") && url::Url::parse(s).is_ok() }

Prevention

When it happens

Trigger: Running any paru command that reaches run2 with Ssh enabled and an aur_url that is empty, scheme-less, already ssh://, or otherwise not a valid https URL.

Common situations: Hand-edited paru.conf with AurUrl set to an ssh URL or a bare hostname; environment where config file was migrated from another AUR helper with a different URL format.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


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

Appendix: source

Thrown at src/lib.rs:181

    if let Some(ref config_path) = config.config_path {
        let file = read_to_string(config_path)?;
        let name = config_path.display().to_string();
        config.parse(Some(name.as_str()), &file)?;
    };

    if args.is_empty() {
        config.parse_args(["-Syu"])?;
    } else {
        config.parse_args(args)?;
    }

    let aur_url = if config.ssh {
        config
            .aur_url
            .to_string()
            .replacen("https://", "ssh://aur@", 1)
            .parse()
            .expect("change AUR URL schema from HTTPS to SSH")
    } else {
        config.aur_url.clone()
    };

    config.fetch = aur_fetch::Fetch {
        git: config.git_bin.clone().into(),
        git_flags: config.git_flags.clone(),
        clone_dir: config.build_dir.clone(),
        diff_dir: config.cache_dir.join("diff"),
        aur_url,
    };

    let mut fetch = config.fetch.clone();
    fetch.clone_dir = config.build_dir.join("repo");
    fetch.diff_dir = config.cache_dir.join("diff/repo");
    config.pkgbuild_repos.fetch = fetch;

    log::debug!("{:#?}", config);

View on GitHub (pinned to 9ac3578807)