jdx/mise · error

invalid remote global configuration path

Error message

invalid remote global configuration path

What it means

Thrown by `run_staged` when the remote host's mise reports a global configuration directory (via `mise ssh --global-config-directory`) that is not an absolute Unix path or contains line breaks. The returned path is used to install/preview configuration remotely; a malformed response means the remote mise is broken or incompatible.

Source

Thrown at src/system/remote.rs:620

            install.push("--repository-yes");
        }
        // the whole operation previews: the helper inspects the target and the
        // repository and says what it would write, before the bootstrap preview
        if options.dry_run {
            install.push("--repository-dry-run");
        }
        if preview_setup {
            install.extend(["--repository-preview-directory", &preview_directory]);
        }
        // The helper uses the target's XDG/global-config environment. Only its
        // absolute result, never the staging directory, becomes trusted config.
        let path = session
            .output_async(&[&mise, "ssh", "--global-config-directory"])
            .await?
            .trim()
            .to_string();
        if !path.starts_with('/') || path.contains(['\n', '\r']) {
            bail!("invalid remote global configuration path");
        }
        session.status_async(&install, true).await?;
        if options.dry_run && !preview_setup && !remote_directory_exists(session, &path).await? {
            // nothing was written, so there is no configuration to preview the
            // bootstrap against yet
            miseprintln!(
                "Would then run `mise bootstrap --dry-run` in {path} on {} once the configuration exists there",
                session.host.name
            );
            if options.relay.is_some() {
                info!(
                    "borrowed GitHub access has ended; future private updates require remote credentials or another relay-enabled session"
                );
            }
            return Ok(());
        }
        if preview_setup {
            preview_directory

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. SSH into the host and run `mise ssh --global-config-directory` manually to see the raw output
  2. Remove any `echo`/debug output from the remote shell rc files (.bashrc/.profile) that pollutes non-interactive command output
  3. Update mise on the remote host to a version that supports `--global-config-directory`
  4. Fix HOME/MISE_* env on the host so the global config directory resolves to an absolute path

Example fix

// before (~/.bashrc on remote host)
echo "welcome"
// after (guard interactive-only output)
if [[ $- == *i* ]]; then
  echo "welcome"
fi
Defensive patterns

Strategy: try-catch

Validate before calling

ssh host 'mise ssh --global-config-directory' | grep -E '^/' && echo ok || echo 'remote mise output polluted or unsupported'

Try / catch

match result {
    Err(e) if e.to_string().contains("invalid remote global configuration path") => {
        // check remote shell rc output and remote mise version, then retry
    }
    other => other?,
}

Prevention

When it happens

Trigger: Running a staged remote install where the remote `mise ssh --global-config-directory` output is empty, relative (doesn't start with '/'), contains a warning line, or has trailing/newline-embedded text from shell profile output on the host.

Common situations: Remote shell rc files printing extra output that pollutes command stdout; very old or custom mise build on the host that doesn't support the flag properly; MISE_DATA_DIR/HOME misconfigured on the remote so the path is empty.

Related errors


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