astrid-runtime/astrid · error
Source path does not exist: {source}
Error message
Source path does not exist: {source} What it means
install_from_local is given a source path (a .capsule archive or a project directory) and refuses to proceed when that path does not exist on disk. It is a fail-fast guard at the very top of the local-install flow, since nothing downstream (daemon install, unpack, auto-build) can work without a real file or directory. The message echoes the exact source string so the user can see which path was rejected.
Source
Thrown at crates/astrid-cli/src/commands/capsule/install.rs:658
context.prompt,
);
}
bail!("astrid-build produced no .capsule archive.");
}
async fn install_from_local(
source: &str,
workspace: bool,
home: &AstridHome,
original_source: Option<&str>,
principal: &astrid_core::PrincipalId,
expected: Option<ExpectedCapsule<'_>>,
prompt: &ManualInstallOptions,
) -> anyhow::Result<Vec<InstalledCapsuleOutcome>> {
let source_path = Path::new(source);
if !source_path.exists() {
bail!("Source path does not exist: {source}");
}
// Unpack `.capsule` archive when source is a file.
if source_path.is_file() && source.ends_with(".capsule") {
if !workspace {
let installed = super::install_daemon::install_local_via_daemon_outcome(
source,
prompt,
daemon_install_authority(source, principal, prompt)?,
)
.await?;
return Ok(vec![installed]);
}
return unpack_via_lib(
source_path,
workspace,
home,
original_source,View on GitHub (pinned to affd8760f4)
Solutions
- Verify the path exists: run `ls -la <source>` (or `test -e <source> && echo ok`) from the same working directory the CLI runs in.
- Fix typos or use an absolute path so the command works regardless of cwd: `astrid capsule install /abs/path/to/capsule.capsule`.
- If the artifact should have been downloaded/built first, produce it before installing (e.g. `astrid-build <dir> --output dist --type rust`).
- If you meant to install from the registry rather than a local file, use the registry install command instead of passing a local path.
- Check that the path ends with `.capsule` (file) or contains Cargo.toml/Capsule.toml (directory) so it is routed to the right install branch.
Example fix
// before astrid capsule install ./dist/my-capsle.capsule // typo, file not found // after astrid capsule install ./dist/my-capsule.capsule // verified with ls first
Defensive patterns
Strategy: validation
Validate before calling
let p = std::path::Path::new(source);
if !p.exists() {
eprintln!("source path {} does not exist (cwd: {:?})", source, std::env::current_dir()?);
std::process::exit(1);
} Type guard
fn source_exists(source: &str) -> bool { std::path::Path::new(source).exists() } Prevention
- Use absolute paths in scripts so the install command is cwd-independent.
- Run `test -e "$ARTIFACT"` immediately before invoking capsule install in CI.
- Check download/build steps completed (artifact present and non-empty) before installing.
- Don't pass registry identifiers to local install; use the matching registry command.
When it happens
Trigger: Calling `astrid capsule install <source>` (or install_from_local directly) where <source> is a path that does not exist: a typo'd filename, a .capsule archive deleted after download, a relative path evaluated from a different working directory, or a remote/registry identifier mistakenly passed to local install.
Common situations: Typing `astrid capsule install ./my-capsule.capsule` from the wrong directory; a CI script downloads the artifact to a temp dir but passes a stale path; shell variable expansion yields an empty path; confusing a capsule registry name with a local file path.
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
- source path does not exist: {source}
- leftover capsule authority receipt has no file name: {}
- capsule source is neither a directory nor a regular file: {}
- {name} not found. Ensure it is installed alongside the astri
- no Capsule.toml in {} — run `astrid capsule check` from a ca
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/9520e0b5568505cd.
Report an issue: GitHub.