astrid-runtime/astrid · error

No Capsule.toml found in {}

Error message

No Capsule.toml found in {}

What it means

install_from_local_path_internal expects the source directory to be a capsule source tree containing a Capsule.toml manifest at its root. When manifest_path.exists() fails, the install cannot determine the capsule identity, version, or contents, so it bails immediately. This is the library's guard against being handed an arbitrary directory instead of a capsule package.

Source

Thrown at crates/astrid-capsule-install/src/local.rs:569

             RuntimePrincipalStore; route the request through KernelRequest::InstallCapsule"
        );
    }
    let checked_workspace = if options.workspace {
        let root = workspace
            .root
            .context("workspace install requires a workspace root")?;
        Some(
            workspace
                .layout
                .resolve(root)
                .context("selected workspace state path is unsafe")?,
        )
    } else {
        None
    };
    let manifest_path = source_dir.join("Capsule.toml");
    if !manifest_path.exists() {
        bail!("No Capsule.toml found in {}", source_dir.display());
    }
    let manifest = load_manifest(&manifest_path).context("failed to load Capsule manifest")?;
    let id = CapsuleId::new(manifest.package.name.clone())?;
    if let Some(expected) = expected
        && id != *expected.id
    {
        bail!(
            "capsule identity mismatch: expected '{}', manifest declares '{id}'",
            expected.id
        );
    }
    let installed_version = manifest.package.version.clone();
    if let Some(expected_version) = expected.and_then(|expected| expected.version)
        && installed_version != expected_version
    {
        bail!(
            "capsule version mismatch for '{id}': expected '{expected_version}', manifest declares '{installed_version}'"
        );

View on GitHub (pinned to affd8760f4)

Solutions

  1. Run `ls <source_dir>/Capsule.toml` to confirm the manifest exists at exactly that path
  2. Pass the directory that directly contains Capsule.toml, not an ancestor or extracted wrapper folder
  3. If the capsule was never scaffolded, create a Capsule.toml (e.g. via the capsule init tooling)
  4. Fix any path/typos or extraction issues so the manifest sits at source_dir/Capsule.toml

Example fix

// before
install_from_local_path_for_principal_in_workspace("./target/extracted", ...)?;
// after
let dir = std::path::Path::new("./target/extracted/app-core");
assert!(dir.join("Capsule.toml").exists(), "Capsule.toml missing");
install_from_local_path_for_principal_in_workspace(dir, ...)?;
Defensive patterns

Strategy: validation

Validate before calling

fn assert_capsule_source(dir: &Path) -> anyhow::Result<()> {
    let p = dir.join("Capsule.toml");
    anyhow::ensure!(p.is_file(), "{} does not contain Capsule.toml", dir.display());
    Ok(())
}

Type guard

fn is_capsule_source_dir(dir: &Path) -> bool {
    dir.join("Capsule.toml").is_file()
}

Try / catch

match install_result {
    Err(e) if e.to_string().starts_with("No Capsule.toml found") => {
        eprintln!("check source_dir: {}", e);
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling any install_from_local_path_* wrapper with a source_dir that lacks a Capsule.toml file at its root (typo in directory, pointed at repo root instead of the crate dir, unpacked archive missing the manifest, wrong path separator handling).

Common situations: Pointing the installer at a parent/child directory of the capsule; a fresh clone where the manifest is gitignored or not yet created; extracting a capsule archive into a nested folder (e.g. pkg-1.0.0/Capsule.toml) and passing the wrong level; forgetting `cargo capsule init` scaffolding.

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