astrid-runtime/astrid · error

seal requires a local Distro.toml path or its directory; {di

Error message

seal requires a local Distro.toml path or its directory; {distro:?} is not a file or directory

What it means

resolve_manifest_path's final guard: after the directory and file cases fail, the given distro argument is neither an existing directory nor an existing file, so sealing cannot proceed and it bails explaining what seal requires.

Source

Thrown at crates/astrid-cli/src/commands/distro/seal.rs:188

    )
    .await
    .map(Some)
}

/// Resolve a seal `distro` argument to a `Distro.toml` path.
fn resolve_manifest_path(distro: &str) -> anyhow::Result<PathBuf> {
    let p = Path::new(distro);
    if p.is_dir() {
        let candidate = p.join("Distro.toml");
        if candidate.is_file() {
            return Ok(candidate);
        }
        bail!("{} contains no Distro.toml", p.display());
    }
    if p.is_file() {
        return Ok(p.to_path_buf());
    }
    bail!(
        "seal requires a local Distro.toml path or its directory; {distro:?} is not a file or directory"
    )
}

/// Load a 32-byte raw ed25519 secret key from `path`. Never logged.
fn load_signing_key(path: &Path) -> anyhow::Result<astrid_crypto::KeyPair> {
    let bytes = std::fs::read(path)
        .with_context(|| format!("failed to read signing key {}", path.display()))?;
    if bytes.len() != 32 {
        bail!(
            "signing key {} must be exactly 32 raw bytes (got {})",
            path.display(),
            bytes.len()
        );
    }
    astrid_crypto::KeyPair::from_secret_key(&bytes)
        .map_err(|e| anyhow::anyhow!("invalid ed25519 secret key: {e}"))
}

View on GitHub (pinned to affd8760f4)

Solutions

  1. Check the path exists with `ls <path>` and correct the typo or cd to the right directory
  2. Pass an explicit path to Distro.toml or its containing directory
  3. Create/restore the Distro.toml if the project was cleaned or not yet initialized

Example fix

// before
astrid seal ./distro.toml     # file doesn't exist (wrong name)
// after
astrid seal ./Distro.toml
Defensive patterns

Strategy: validation

Validate before calling

let p = std::path::Path::new(distro);
if !p.exists() {
    anyhow::bail!("seal target {:?} does not exist", distro);
}

Prevention

When it happens

Trigger: `astrid seal some/path` where some/path does not exist (typo, wrong cwd, not yet generated); passing a glob or a registry name where a local path is required.

Common situations: Running seal before cloning/creating the project; shell expansion quirks leaving a literal glob; running from a different working directory than expected; deleted manifest after a clean.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09). Data as JSON: /api/errors/1acca5396468981c. Report an issue: GitHub.