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

When ssh mode is enabled, the configured https:// AUR URL is rewritten to ssh://aur@... and re-parsed into a Url. The expect fires when the rewritten string fails to parse as a valid URL. Given a valid https URL the replacement always parses, so this is an internal invariant: the configured aur_url was not a normal https:// URL to begin with.

Solutions

  1. Set aur_url in paru.conf to a plain https:// URL, e.g. https://aur.archlinux.org/.
  2. Remove ssh://aur@ prefix from aur_url if you already put it there; paru adds it when Ssh = true.
  3. Disable the Ssh option if you intentionally want to use an ssh URL directly.

Example fix

// before (paru.conf)
AurUrl = ssh://aur@aur.archlinux.org/
Ssh = true
// after
AurUrl = https://aur.archlinux.org/
Ssh = true
Defensive patterns

Strategy: validation

Validate before calling

grep -E '^AurUrl' ~/.config/paru/paru.conf  # must start with https://

Type guard

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

Prevention

When it happens

Trigger: Setting aur_url in paru.conf to something that is not a well-formed https:// URL (missing scheme, ssh:// already, typo, trailing junk) and then enabling the Ssh option.

Common situations: Users copy-pasting an ssh://aur@aur.archlinux.org/... URL into aur_url while also enabling ssh mode, causing double rewriting; typos or custom AUR mirrors with unusual schemes.

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/f3a8356ca4f648fb. Report an issue: GitHub.

Appendix: source

Thrown at src/config.rs:754

            let rpc_url = match &self.aur_rpc_url {
                Some(rpc) => rpc.to_string(),
                None => self.aur_url.join("rpc")?.to_string(),
            };

            self.raur = raur::Handle::new_with_settings(client, rpc_url);
        }

        #[cfg(feature = "mock")]
        {
            self.raur = crate::mock::Mock::new()?;
        }

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

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

        self.pkgbuild_repos.fetch = aur_fetch::Fetch {
            git: self.git_bin.clone().into(),
            git_flags: self.git_flags.clone(),
            clone_dir: self.build_dir.join("repo"),
            diff_dir: self.cache_dir.join("repo/diff"),
            aur_url,

View on GitHub (pinned to 9ac3578807)