astrid-runtime/astrid · error

Capsule ' ' was installed before source tracking was added…

Error message

Capsule '{name}' was installed before source tracking was added. Re-install it manually to record the source.

What it means

update_capsule found meta.json but its `source` field is absent, meaning the capsule was installed before source tracking existed. Without a recorded source the updater cannot know where to re-fetch updates from.

Solutions

  1. Re-install the capsule manually so meta.json is written with the source field, then run the update again
  2. If the original source is known, add a valid `source` entry to the capsule's meta.json
  3. Recreate the capsule from its canonical source via capsule install

Example fix

// before: meta.json without source
{"name": "my-capsule"}
// after: reinstall to get
{"name": "my-capsule", "source": "git+https://example.com/my-capsule.git"}
Defensive patterns

Strategy: validation

Validate before calling

let meta = read_meta(&target_dir)?;
if meta.source.is_none() {
    eprintln!("Capsule '{}' predates source tracking; reinstalling is required.", name);
    return Ok(());
}

Try / catch

match update_capsule(name).await {
    Err(e) if e.to_string().contains("before source tracking") => reinstall_manually(name)?,
    other => other?,
}

Prevention

When it happens

Trigger: Updating a capsule whose meta.json exists but predates the addition of the `source` field — i.e. capsules installed by an older astrid-cli that wrote partial metadata.

Common situations: Legacy capsule installations carried over across astrid-cli upgrades; meta.json hand-written or stripped of fields by tooling.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at crates/astrid-cli/src/commands/capsule/install_update.rs:148

            &home,
            &principal,
            name,
            workspace,
            crate::workspace_layout::current(),
        )?;
        if !target_dir.exists() {
            bail!("Capsule '{name}' is not installed.");
        }

        let meta = read_meta(&target_dir).ok_or_else(|| {
            anyhow::anyhow!(
                "Capsule '{name}' has no meta.json - cannot determine original source. \
                 Re-install it manually."
            )
        })?;

        let source = meta.source.ok_or_else(|| {
            anyhow::anyhow!(
                "Capsule '{name}' was installed before source tracking was added. \
                 Re-install it manually to record the source."
            )
        })?;

        eprintln!("Updating {name} from {source}...");
        // Re-install exactly the capsule being updated. When `source` is a
        // monorepo release that ships several `.capsule` assets, pass `name`
        // as the selector so update refreshes only that one — not every
        // capsule the release contains.
        install_capsule_with_options(
            &source,
            Some(name),
            workspace,
            false,
            approve_untrusted,
            &[],
        )

View on GitHub (pinned to affd8760f4)