jdx/mise · error

configuration disappeared from preview commit

Error message

configuration disappeared from preview commit

What it means

While building the preview configuration from the snapshot commit, the code iterates ls_tree entries and looks each tracked config path up with object_at. If a path that appeared in ls_tree can no longer be resolved in the head commit, the internal invariant 'every ls-tree entry has an object' is broken and the library bails.

Source

Thrown at src/system/history/sync/onboard.rs:91

    Ok((temp, preview))
}

fn preview_configuration(store: &Store) -> Result<tempfile::TempDir> {
    let temp = tempfile::tempdir()?;
    let repo = store
        .repo()
        .ok_or_else(|| eyre::eyre!("preview requires git"))?;
    let head = repo
        .ref_oid(UPSTREAM_REF)?
        .ok_or_else(|| eyre::eyre!("setup preview has no fetched branch"))?;
    let encrypted = super::files::encrypted_paths(repo, Some(&head))?;
    let tracked = crate::system::history::manifest::Manifest::read(repo, &head)?
        .ok_or_else(|| eyre::eyre!("setup repository has no enrollment metadata"))?
        .tracking()?;
    for entry in repo.ls_tree(&head)? {
        if let Some(relative) = preview_config_path(&tracked, &entry.path)? {
            let Some((mode, oid)) = repo.object_at(&head, &entry.path)? else {
                bail!("configuration disappeared from preview commit");
            };
            let (mode, oid) = if encrypted.contains(&entry.path) {
                super::files::decrypt(repo, &entry.path, &(mode, oid), true)?
            } else {
                (mode, oid)
            };
            crate::system::history::replay::write_path(
                repo,
                &temp.path().join(relative),
                &mode,
                &oid,
            )?;
        }
    }
    // Machine-local inputs are not published, but affect the real bootstrap.
    let local = global_config_dir().join("config.local.toml");
    if local.is_file() {
        std::fs::copy(local, temp.path().join("config.local.toml"))?;

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Re-run the onboarding preview so a fresh, complete snapshot is taken.
  2. Verify repository integrity with git fsck on the snapshot repository.
  3. Ensure the snapshot fetch is complete (no partial-clone filters) so all blobs referenced by the head commit are present.
  4. If it recurs, capture the entry path and head oid and report it — this indicates an internal invariant violation or repository corruption.
Defensive patterns

Strategy: try-catch

Validate before calling

// verify all ls_tree entries resolve in the head commit before processing
for entry in repo.ls_tree(&head)? {
    if repo.object_at(&head, &entry.path)?.is_none() {
        return Err(format!("missing object for {} in preview commit", entry.path));
    }
}

Try / catch

match preview_configuration(&snapshot) {
    Err(e) if e.to_string().contains("configuration disappeared") => {
        eprintln!("snapshot incomplete or repo mutated; retake the preview snapshot");
    }
    other => other?,
}

Prevention

When it happens

Trigger: preview_configuration (called from run or the preview decryption test) encounters an ls_tree entry whose blob is missing from the commit — typically a race where the snapshot commit changed between index build and object lookup, or a corrupted/incomplete snapshot where blobs were not fetched.

Common situations: The preview snapshot fetch was partial (shallow or filtered fetch dropping blobs); the source repository mutated mid-preview; repository corruption from a crashed process or disk issue.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/68fc25cdababdd51. Report an issue: GitHub.