jdx/mise · error

invalid dotfile declarations; correct them before publishing

Error message

invalid dotfile declarations; correct them before publishing

What it means

share::current builds the report of dotfiles to publish and refuses to proceed when the tracked set contains invalid dotfile declarations. Publishing from a broken tracked set could share wrong or missing files, so it aborts with a request to fix the declarations first.

Solutions

  1. Inspect the invalid entries in the tracked set and correct or remove them (e.g. `mise history track`/untrack the offending paths).
  2. Fix path issues: keep tracked paths under home or the mise config dir, avoid symlinked parents, use UTF-8 names.
  3. Re-run the share/publish command once `tracked.invalid` is empty.

Example fix

// before: declaration for ../outside-home/settings.json
// after: move the file under ~/ (or config dir) and re-track
mv ../outside-home/settings.json ~/settings.json
mise history track ~/settings.json
Defensive patterns

Strategy: validation

Validate before calling

if !tracked.invalid.is_empty() {
  eprintln!("fix invalid declarations: {:?}", tracked.invalid);
  return;
}

Try / catch

match share::current(&repo, &tracked) {
  Err(e) if e.to_string().contains("invalid dotfile declarations") => fix_declarations(),
  other => other?,
}

Prevention

When it happens

Trigger: Calling share::current (and thus any publish/share flow) while `tracked.invalid` is non-empty, e.g. after adding a path that failed portability, symlink, or UTF-8 validation.

Common situations: A dotfile declaration pointing outside home/config roots; a tracked path on a non-UTF-8 filesystem entry; a stale declaration after moving files; hand-edited manifest entries.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/8a75c6b746a21ef5. Report an issue: GitHub.

Appendix: source

Thrown at src/system/history/sync/share.rs:39

pub(crate) struct ShareReport {
    pub files: BTreeMap<String, SharedFile>,
    pub checkpoint: Option<String>,
}

impl ShareReport {
    pub(crate) fn objects(&self) -> BTreeMap<String, (String, String)> {
        self.files
            .iter()
            .map(|(path, file)| (path.clone(), (file.mode.clone(), file.oid.clone())))
            .collect()
    }
}

/// Read committed files, including manually saved files missing on disk.
/// Live directory enumeration is never the authority for a saved version.
pub(crate) fn current(repo: &HistoryRepo, tracked: &TrackedSet) -> Result<ShareReport> {
    if !tracked.invalid.is_empty() {
        eyre::bail!("invalid dotfile declarations; correct them before publishing");
    }
    let mut report = ShareReport::default();
    let Some(head) = repo.ref_oid(HistoryRepo::HISTORY_REF)? else {
        return Ok(report);
    };
    report.checkpoint = Some(head.clone());
    let roots = Roots::current();
    for file in repo.ls_tree(&head)? {
        let (local, variant) = match roots.locate(&file.path) {
            Located::Config(path) => (path, None),
            Located::Tracked { path, variant } => (path, variant),
            Located::Marker | Located::Unmapped => continue,
        };
        let Some(entry) = tracked.entry_for(&local) else {
            continue;
        };
        if entry.variant != variant {
            continue;

View on GitHub (pinned to 533346cc37)