astrid-runtime/astrid · error

source path does not exist: {source}

Error message

source path does not exist: {source}

What it means

load_source_manifest resolves the --source path: if it's a file it reads the capsule archive manifest, if it's a directory it reads Capsule.toml there, and if the path doesn't exist at all it bails. The install was pointed at a nonexistent source path.

Source

Thrown at crates/astrid-cli/src/commands/capsule/install_daemon.rs:404

                .await?
        };
        crate::admin_client::into_result(response)?;
    }
    Ok(())
}

fn load_source_manifest(source: &str) -> anyhow::Result<CapsuleManifest> {
    let source = source.strip_prefix("file://").unwrap_or(source);
    let path = Path::new(source);
    if path.is_dir() {
        return astrid_capsule::discovery::load_manifest(&path.join("Capsule.toml"))
            .map_err(Into::into);
    }
    if path.is_file() {
        return astrid_capsule_install::read_archive_manifest(path)
            .with_context(|| format!("read Capsule.toml from {}", path.display()));
    }
    bail!("source path does not exist: {source}")
}

fn validate_values(
    manifest: &CapsuleManifest,
    items: &[String],
) -> anyhow::Result<Vec<DaemonEnvValue>> {
    let mut parsed = HashMap::new();
    for item in items {
        let (key, value) = item
            .split_once('=')
            .ok_or_else(|| anyhow::anyhow!("--var must be KEY=VALUE (got {item:?})"))?;
        if key.is_empty() || key.contains('\0') || key.contains(':') {
            bail!("--var has an invalid key (got {key:?})");
        }
        if parsed.insert(key.to_owned(), value.to_owned()).is_some() {
            bail!("--var '{key}' was supplied more than once");
        }
    }

View on GitHub (pinned to affd8760f4)

Solutions

  1. Verify the path exists: ls <source> before installing.
  2. Build the capsule first so the archive/Capsule.toml is produced.
  3. Run the command from the capsule project root or pass an absolute path.
  4. Fix typos in the --source flag.

Example fix

// before
astrid capsule install --source ./target/capsule.wasm
// after
ls ./target/capsule.wasm  # confirm it exists after `astrid capsule build`
astrid capsule install --source ./target/debug/capsule.wasm
Defensive patterns

Strategy: validation

Validate before calling

if !std::path::Path::new(source).exists() { eprintln!("source missing: {source}"); std::process::exit(1); }

Try / catch

on 'source path does not exist', fail fast in the script before invoking install; do not retry.

Prevention

When it happens

Trigger: Running capsule install with a --source argument whose path is missing (typo, deleted build output, wrong working directory, or a path that failed to build).

Common situations: Pointing at a .wasm/archive that was never built or was cleaned; typos in the path; running from a different directory in CI; stale path after a refactor.

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