{"record":{"id":"652b2cfdcf414f86","repo":"jdx/mise","slug":"dp-is-not-executable","errorCode":null,"errorMessage":"`{dp}` is not executable. {}","messagePattern":"`(.+?)` is not executable\\. (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/run.rs","lineNumber":1383,"sourceCode":"        if self.task_cache.enabled() && task.cache.as_ref().is_some_and(|cache| cache.enabled) {\n            Settings::get().ensure_experimental(\"task artifact caching\")?;\n        }\n        if task.rust_cache.as_ref().is_some_and(|cache| cache.enabled) {\n            Settings::get().ensure_experimental(\"Rust action caching\")?;\n        }\n        if !task.pass_through_env.is_empty() {\n            Settings::get().ensure_experimental(\"task environment pass-through\")?;\n        }\n        if let Some(path) = &task.file\n            && path.exists()\n            && !file::is_executable(path)\n        {\n            let dp = crate::file::display_path(path);\n            // Only offer the fix where accepting it can change the answer. `make_executable` is a\n            // no-op on Windows, so the prompt would take a \"yes\" and then fail anyway; the same\n            // reasoning already keeps `make_task_executable` from running there.\n            if cfg!(windows) {\n                bail!(\n                    \"`{dp}` is not executable. {}\",\n                    file::make_executable_hint(path)\n                )\n            }\n            let msg = format!(\"Script `{dp}` is not executable. Make it executable?\");\n            if ui::confirm(msg)? {\n                file::make_executable(path)?;\n            } else {\n                bail!(\n                    \"`{dp}` is not executable. {}\",\n                    file::make_executable_hint(path)\n                )\n            }\n        }\n        Ok(())\n    }\n\n    fn timings(&self) -> bool {","sourceCodeStart":1365,"sourceCodeEnd":1401,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/cli/run.rs#L1365-L1401","documentation":"A file-based task (task.file exists) must be executable for `mise run` to launch it. On Windows, `chmod` is meaningless — mise decides executability by shebang or by file extension (windows_executable_extensions setting) — so the interactive 'make executable?' fix is skipped (it could not change the answer) and mise directly bails with the platform-correct remedy.","triggerScenarios":"`mise run <task>` on Windows where the task's script file has no shebang and no extension listed in windows_executable_extensions (default: .exe, .bat, .cmd, .ps1, …).","commonSituations":"Checking a Unix-authored tasks/ script into a Windows checkout (no extension, no or unrecognized shebang); generated task files missing a shebang; users who changed windows_executable_extensions and renamed files inconsistently.","solutions":["Add a shebang line as the first line of the script (e.g. `#!/bin/sh` or `#!/usr/bin/env python`)","Rename the script with an accepted extension (see the list in the error text / the windows_executable_extensions setting), and update the task's file path","Or convert the task to a `run = \"...\"` command in mise.toml/tasks.toml so no script file is needed"],"exampleFix":"# before: tasks/hello.txt with `echo hi`\nmise run hello\n# after: rename to tasks/hello.ps1 (extension in windows_executable_extensions), or add `#!/bin/sh` as line 1\nmise run hello","handlingStrategy":"validation","validationCode":"# bash (run on the authoring machine, cross-platform intent)\nhead -c2 \"$script\" | grep -q '#!' || case \"$script\" in *.exe|*.bat|*.cmd|*.ps1) ;; *) echo \"$script needs a shebang or a Windows-executable extension\" >&2; exit 1;; esac\nmise run \"$task\"","typeGuard":"is_windows_executable_script() {\n  head -c2 \"$1\" | grep -q '#!' && return 0\n  case \"$1\" in *.exe|*.bat|*.cmd|*.ps1) return 0;; *) return 1;; esac\n}","tryCatchPattern":null,"preventionTips":["Start every task script with a shebang, even on Windows-only projects — it is the portable fix","Name task scripts with extensions listed in windows_executable_extensions if they must run on Windows","Prefer `run = \"...\"` task definitions in mise.toml/tasks.toml for cross-platform tasks; reserve file scripts for Unix-only workflows"],"tags":["mise","tasks","windows","executable","permissions"],"backgroundTag":"file-not-executable","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}