{"record":{"id":"48662249ccecb87d","repo":"jdx/mise","slug":"remote-mise-command-must-be-an-executable-name-or","errorCode":null,"errorMessage":"remote mise command must be an executable name or path: {command:?}","messagePattern":"remote mise command must be an executable name or path: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/remote.rs","lineNumber":1508,"sourceCode":"    validated_remote_command(output.strip_suffix('\\n').unwrap_or(output))\n}\n\nfn validated_absolute_remote_path_output(output: &str, kind: &str) -> Result<String> {\n    let path = output.strip_suffix('\\n').unwrap_or(output);\n    if !path.starts_with('/') || path.contains(['\\0', '\\n', '\\r']) {\n        bail!(\"{kind} returned an unsafe absolute path: {path:?}\");\n    }\n    Ok(path.to_string())\n}\n\nfn validate_remote_executable(command: &str) -> Result<()> {\n    validate_value(\"mise command\", command)?;\n    let is_path = command.contains('/');\n    if command.starts_with('-')\n        || command.contains(['\\n', '\\r'])\n        || (!is_path && command.chars().any(char::is_whitespace))\n    {\n        bail!(\"remote mise command must be an executable name or path: {command:?}\");\n    }\n    Ok(())\n}\n\nfn shell_quote(value: &str) -> String {\n    shell_words::join([value])\n}\n\nfn normalize_os(value: &str) -> String {\n    match value.trim().to_ascii_lowercase().as_str() {\n        \"darwin\" | \"macos\" => \"macos\".to_string(),\n        \"linux\" => \"linux\".to_string(),\n        other => other.to_string(),\n    }\n}\n\nfn normalize_arch(value: &str) -> String {\n    match value.trim().to_ascii_lowercase().as_str() {","sourceCodeStart":1490,"sourceCodeEnd":1526,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/remote.rs#L1490-L1526","documentation":"remote_mise must be a single executable token: validate_remote_executable rejects values that start with '-', contain newlines/CRs, or — when they contain no '/' — contain any whitespace. The intent is one argv element: either a bare command name like 'mise' or a path like '/usr/local/bin/mise'; arguments are not allowed in this field.","triggerScenarios":"Setting remote_mise = \"mise run\" or \"/opt/mise/mise --verbose\" (space + no slash, or treated as one atom); a value beginning with '-' would be parsed as an ssh flag; embedded newlines break the one-line contract.","commonSituations":"Users trying to pass flags through remote_mise; copy-pasting a full command line from docs; trailing whitespace/newline accidentally included when the value comes from an env var or generated config.","solutions":["Use a single token: remote_mise = \"mise\" or remote_mise = \"/usr/local/bin/mise\"","Put mise arguments in the actual task/command invocation, not in remote_mise","Trim whitespace/newlines from generated or environment-supplied values","If a wrapper is needed, create a remote shell script with an absolute path and point remote_mise at it"],"exampleFix":"# before (mise.toml)\nremote_mise = \"mise run --cd /srv\"\n\n# after\nremote_mise = \"/usr/local/bin/mise\"","handlingStrategy":"validation","validationCode":"# lint remote_mise values: one token, no leading dash, args not allowed\ncase \"$REMOTE_MISE\" in\n  -*|*\" \"*|*\"$'\\n'\"*) echo \"invalid remote_mise: $REMOTE_MISE\";;\n  *) echo ok;;\nesac","typeGuard":"fn remoteMiseValid(cmd: &str) -> bool {\n    let is_path = cmd.contains('/');\n    !cmd.is_empty()\n        && !cmd.contains('\\0')\n        && !cmd.starts_with('-')\n        && !cmd.contains(['\\n', '\\r'])\n        && (is_path || !cmd.chars().any(char::is_whitespace))\n}","tryCatchPattern":"if !remoteMiseValid(&configured) {\n    return Err(eyre::eyre!(\"remote_mise must be a single executable name or path\"));\n}\nhost.validate()?;","preventionTips":["Treat remote_mise as a path/name field, never a command line","Pass mise flags at task invocation time, not in host config","Trim generated values of trailing newlines/spaces"],"tags":["remote","ssh","validation","config","executable-path"],"backgroundTag":"ssh-argument-validation-failed","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}