jdx/mise · error

source contains machine-local configuration

Error message

source contains machine-local configuration ({entry}); remove it from the repository before onboarding

What it means

During adoption of a transferred global-configuration repository, mise inspects every file in the bundle's tree and rejects any path ending in `.local.toml`. These files are machine-local configuration (per-machine overrides) and must not be brought into a shared/onboarded repository checkout. The check is case-insensitive on the extension and runs before anything is written to the destination.

Solutions

  1. Remove the `*.local.toml` file from the source repository: `git rm --cached <file>.local.toml` and commit.
  2. Add `*.local.toml` to the source repo's `.gitignore` so it is never tracked again.
  3. Move machine-local settings into the `.local.toml` on the destination machine instead of the source repo.
  4. Re-package the transfer bundle after the file is removed and retry the install.

Example fix

// before: source repo tracks settings.local.toml
$ git ls-files | grep local.toml
settings.local.toml

// after
$ echo '*.local.toml' >> .gitignore
$ git rm --cached settings.local.toml
$ git commit -m 'stop tracking machine-local config'
Defensive patterns

Strategy: validation

Validate before calling

const BAD = /\.local\.toml$/i;
const offending = trackedFiles.filter(f => BAD.test(f));
if (offending.length) throw new Error(`remove machine-local files first: ${offending.join(', ')}`);

Try / catch

try {
  await installSource(bundle, origin);
} catch (e) {
  if (/machine-local configuration/.test(String(e.cause ?? e))) {
    console.error('git rm --cached the *.local.toml files and re-create the bundle');
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling install/install_source/preview_source (via install_at) with a bundle whose source repository contains a tracked file matching `*.local.toml` anywhere in the tree; the source path itself is otherwise safe (no traversal, no `.git` components).

Common situations: A developer committed their local override file (e.g. `mise.local.toml`, `config.local.toml`) instead of gitignoring it, then tried to onboard the repository onto another machine; CI packaging the config repo included local overrides.

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/442c2b12492da929. Report an issue: GitHub.

Appendix: source

Thrown at src/system/remote_repository.rs:236

        .output()?;
    if !output.status.success() {
        bail!("invalid transferred repository bundle");
    }
    if git(&checkout, &["rev-parse", "HEAD"])? != revision {
        bail!("transferred revision mismatch");
    }
    let entries = git(&checkout, &["ls-tree", "-r", "-z", "--name-only", revision])?;
    for entry in entries.split('\0').filter(|s| !s.is_empty()) {
        let path = Path::new(entry);
        if path
            .components()
            .any(|c| !matches!(c, std::path::Component::Normal(_)))
            || entry.split('/').any(|p| p.eq_ignore_ascii_case(".git"))
        {
            bail!("unsafe source repository path");
        }
        if entry.to_ascii_lowercase().ends_with(".local.toml") {
            bail!(
                "source contains machine-local configuration ({entry}); remove it from the repository before onboarding"
            );
        }
    }
    git(&checkout, &["remote", "set-url", "origin", origin])?;
    let branch = git(&checkout, &["symbolic-ref", "--short", "HEAD"])?;
    git(
        &checkout,
        &["-c", "core.hooksPath=/dev/null", "checkout", &branch],
    )?;
    if destination.join(".git").exists() {
        if git(destination, &["remote", "get-url", "origin"])? != origin {
            bail!("global configuration origin does not match");
        }
        if !git(
            destination,
            &["status", "--porcelain", "--untracked-files=no"],
        )?

View on GitHub (pinned to 533346cc37)