jdx/mise · error

enrollment conflict in {field}; reconcile repository metadat

Error message

enrollment conflict in {field}; reconcile repository metadata before syncing

What it means

Thrown by `choose` in manifest.rs during three-way merge of enrollment metadata (`Enrollment::merge`). If a field differs between local and remote, and local also differs from base (i.e. both sides changed it), the merge is genuinely conflicted and cannot be resolved automatically; the library asks the user to reconcile repository metadata manually.

Source

Thrown at src/system/history/manifest.rs:140

                self.permissions.insert(portable, *bits);
            }
        }
        self.remove_unenrolled_permissions();
        Ok(())
    }

    /// Merge enrollment by portable path rather than JSON line positions.
    /// Independent additions and policy edits commute; deletion versus a
    /// policy edit remains a conflict, never an implicit reenrollment.
    pub(crate) fn merge(base: &Self, local: &Self, remote: &Self) -> Result<Self> {
        use std::collections::BTreeMap;
        fn choose<T: Clone + Eq>(base: &T, local: &T, remote: &T, field: &str) -> Result<T> {
            if local == remote || remote == base {
                Ok(local.clone())
            } else if local == base {
                Ok(remote.clone())
            } else {
                bail!(
                    "enrollment conflict in {field}; reconcile repository metadata before syncing"
                )
            }
        }
        base.validate()?;
        local.validate()?;
        remote.validate()?;
        if local == remote || remote == base {
            return Ok(local.clone());
        }
        if local == base {
            return Ok(remote.clone());
        }
        let indexed = |manifest: &Self| {
            manifest
                .enrollment
                .iter()
                .map(|entry| (entry.path.clone(), entry.clone()))

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Manually edit the enrollment metadata to the desired value on the local side.
  2. Pull/reset the remote metadata so one side wins, then re-apply your change and sync again.
  3. Re-enroll the affected path to regenerate consistent metadata.
  4. If the remote value is authoritative, reset local metadata to remote before syncing.
Defensive patterns

Strategy: validation

Validate before calling

// compare local vs remote enrollment metadata before sync;
// resolve differing fields manually when both changed since base

Try / catch

// on "enrollment conflict in {field}": stop, edit the manifest field,
// and re-run the sync instead of retrying blindly

Prevention

When it happens

Trigger: Syncing enrollment state when both this machine and the remote repository edited the same enrollment field (e.g. variant name, target path) since the common base version.

Common situations: Editing dotfile enrollment on two machines and syncing both ways; rebasing history where a remote force-push rewrote metadata; merging branches that both modified the manifest.

Related errors


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