{"record":{"id":"966ceb00c9429fc3","repo":"jdx/mise","slug":"invalid-remote-global-configuration-path","errorCode":null,"errorMessage":"invalid remote global configuration path","messagePattern":"invalid remote global configuration path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":620,"sourceCode":"            install.push(\"--repository-yes\");\n        }\n        // the whole operation previews: the helper inspects the target and the\n        // repository and says what it would write, before the bootstrap preview\n        if options.dry_run {\n            install.push(\"--repository-dry-run\");\n        }\n        if preview_setup {\n            install.extend([\"--repository-preview-directory\", &preview_directory]);\n        }\n        // The helper uses the target's XDG/global-config environment. Only its\n        // absolute result, never the staging directory, becomes trusted config.\n        let path = session\n            .output_async(&[&mise, \"ssh\", \"--global-config-directory\"])\n            .await?\n            .trim()\n            .to_string();\n        if !path.starts_with('/') || path.contains(['\\n', '\\r']) {\n            bail!(\"invalid remote global configuration path\");\n        }\n        session.status_async(&install, true).await?;\n        if options.dry_run && !preview_setup && !remote_directory_exists(session, &path).await? {\n            // nothing was written, so there is no configuration to preview the\n            // bootstrap against yet\n            miseprintln!(\n                \"Would then run `mise bootstrap --dry-run` in {path} on {} once the configuration exists there\",\n                session.host.name\n            );\n            if options.relay.is_some() {\n                info!(\n                    \"borrowed GitHub access has ended; future private updates require remote credentials or another relay-enabled session\"\n                );\n            }\n            return Ok(());\n        }\n        if preview_setup {\n            preview_directory","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/remote.rs#L602-L638","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["SSH into the host and run `mise ssh --global-config-directory` manually to see the raw output","Remove any `echo`/debug output from the remote shell rc files (.bashrc/.profile) that pollutes non-interactive command output","Update mise on the remote host to a version that supports `--global-config-directory`","Fix HOME/MISE_* env on the host so the global config directory resolves to an absolute path"],"exampleFix":"// before (~/.bashrc on remote host)\necho \"welcome\"\n// after (guard interactive-only output)\nif [[ $- == *i* ]]; then\n  echo \"welcome\"\nfi","handlingStrategy":"try-catch","validationCode":"ssh host 'mise ssh --global-config-directory' | grep -E '^/' && echo ok || echo 'remote mise output polluted or unsupported'","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"invalid remote global configuration path\") => {\n        // check remote shell rc output and remote mise version, then retry\n    }\n    other => other?,\n}","preventionTips":["Keep remote shell rc files silent for non-interactive sessions","Keep mise on remote hosts reasonably up to date","Test `mise ssh --global-config-directory` manually on new hosts before automating"],"tags":["remote","ssh","mise-binary","path-validation"],"backgroundTag":"unexpected-response-shape","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}