jdx/mise · error

packslip.stampers entry {spec:?}: {host:?} is not a host nam

Error message

packslip.stampers entry {spec:?}: {host:?} is not a host name

What it means

In a packslip.stampers entry host=PIN, the host part must look like a real host name: non-empty, containing a dot, and containing no slashes. This error fires when the host portion fails those checks.

Source

Thrown at src/packslip_stamps.rs:56

    pub(crate) host: String,
    pin: Pin,
}

impl Stamper {
    /// `host=PIN`, where PIN is a minisign public key line, the path of a
    /// `.pub` file, or an `https://` identity prefix for a keyless signer
    /// on GitHub such as `https://github.com/org/registry/`.
    pub(crate) fn parse(spec: &str) -> Result<Stamper> {
        let spec = spec.trim();
        let Some((host, pin)) = spec.split_once('=') else {
            bail!(
                "packslip.stampers entry {spec:?} has no pin; write host=PUBKEY, host=path/to/key.pub, or host=https://github.com/org/repo/"
            );
        };
        let host = host.trim();
        let pin = pin.trim();
        if host.is_empty() || !host.contains('.') || host.contains('/') {
            bail!("packslip.stampers entry {spec:?}: {host:?} is not a host name");
        }
        let pin = if pin.starts_with("https://") {
            Pin::Identity(Policy {
                issuer: Some(GITHUB_ISSUER.into()),
                identity: None,
                identity_prefix: Some(pin.to_string()),
            })
        } else {
            let text = if std::path::Path::new(pin).is_file() {
                file::read_to_string(pin)?
            } else {
                pin.to_string()
            };
            let key = packslip::minisign::PublicKey::parse(&text)
                .map_err(|e| eyre!("packslip.stampers entry for {host}: pubkey: {e}"))?;
            Pin::Key(key)
        };
        Ok(Stamper {

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Move the https://github.com/... identity to the pin (right) side of '='
  2. Use a dotted host name on the left side, e.g. registry.example.com=RWT...
  3. Remove slashes from the host portion

Example fix

// before
[packslip.stampers]
"https://github.com/org/registry/=RWTvK7..."
// after
[packslip.stampers]
"registry.example.com=https://github.com/org/registry/"
Defensive patterns

Strategy: validation

Validate before calling

let host = spec.split('=').next().unwrap_or("");
if host.is_empty() || !host.contains('.') || host.contains('/') {
    return Err(format!("{host:?} is not a valid stamper host"));
}

Try / catch

match result {
    Err(e) if e.to_string().contains("is not a host name") => eprintln!("use a dotted hostname left of '='; put https:// identities on the right"),
    other => other?,
}

Prevention

When it happens

Trigger: Parsing a stampers entry whose text before '=' is empty, lacks a dot (e.g. 'localhost=RWT...'), or contains '/' (e.g. a URL was given as the host).

Common situations: Putting the https:// identity URL on the left side of '=' instead of the pin side; using a bare hostname like 'localhost'; accidentally swapping host and pin around the '='.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/e0fbfefb1489da2c. Report an issue: GitHub.