{"record":{"id":"64d9837f2f408595","repo":"jdx/mise","slug":"no-tasks-defined-in-but-found-non-executabl-64d983","errorCode":null,"errorMessage":"no tasks defined in {}, but found {} non-executable file(s) in {}.\nFiles must be executable to be detected as tasks.\n{}","messagePattern":"no tasks defined in (.+?), but found (.+?) non-executable file\\(s\\) in (.+?)\\.\nFiles must be executable to be detected as tasks\\.\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_list.rs","lineNumber":343,"sourceCode":"        if let Some(task) = make_task_executable(config, name, task_context).await? {\n            return Ok(Some(task));\n        }\n\n        // Check if there are non-executable files in task include directories\n        if let Some(cwd) = &*dirs::CWD {\n            let includes = config::task_includes_for_dir(cwd, &config.config_files)?;\n            let excludes = config::task_excludes_for_dir(cwd, &config.config_files)?;\n            let non_exec_files = find_non_executable_task_files(&includes, &excludes);\n            // The remedy differs by platform and `make_executable_hint` is the only thing that\n            // knows how, so it gets one file to name rather than the list. The count and the\n            // directories below still say how much is affected.\n            if let Some(first) = non_exec_files.first() {\n                let dirs_with_files: Vec<String> = includes\n                    .iter()\n                    .filter(|d| d.is_dir())\n                    .map(display_path)\n                    .collect();\n                bail!(\n                    \"no tasks defined in {}, but found {} non-executable file(s) in {}.\\n\\\n                        Files must be executable to be detected as tasks.\\n\\\n                        {}\",\n                    display_path(dirs::CWD.clone().unwrap_or_default()),\n                    non_exec_files.len(),\n                    dirs_with_files.join(\", \"),\n                    file::make_executable_hint(first),\n                );\n            }\n        }\n\n        bail!(\n            \"no tasks defined in {}. Are you in a project directory?\",\n            display_path(dirs::CWD.clone().unwrap_or_default())\n        );\n    }\n    if let Some(task) = make_task_executable(config, name, task_context).await? {\n        return Ok(Some(task));","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/task_list.rs#L325-L361","documentation":"mise detects file-based tasks in include directories only when the files are executable. If no tasks were defined but the task include directories contain non-executable files that look like candidate tasks, err_no_task throws this error explaining that executability is required, with a hint for making the file executable.","triggerScenarios":"A task include directory (e.g. .mise/tasks/ or mise.toml [tasks].include dir) contains script files lacking the executable bit, and no other tasks are defined; running any `mise run <name>` or `mise tasks` then fails.","commonSituations":"Checked out task scripts on a filesystem that dropped the +x bit (FAT/exFAT mount, Windows checkout, tar extraction without permissions); wrote a new task script with `echo >` and forgot `chmod +x`.","solutions":["Make the task scripts executable: `chmod +x .mise/tasks/*` (or the specific file per the hint in the error)","Re-checkout/extract the repo preserving file modes (git config core.fileMode true, tar -p)","If the files are not meant to be tasks, move them out of the task include directory","Prefer defining tasks in mise.toml [tasks] section instead of file-based tasks if executability is hard to maintain"],"exampleFix":"# before\n$ ls -l .mise/tasks/build   # -rw-r--r--\n\n# after\n$ chmod +x .mise/tasks/build\n$ mise tasks","handlingStrategy":"validation","validationCode":"find .mise/tasks -type f ! -perm -u+x -print 2>/dev/null | head -1 && [ -n \"$(find .mise/tasks -type f ! -perm -u+x 2>/dev/null)\" ] && chmod +x .mise/tasks/*","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always chmod +x new file-based task scripts","Clone/extract with permissions preserved (git, tar -p)","Avoid storing task scripts on filesystems that drop exec bits (exFAT, some network mounts)"],"tags":["tasks","permissions","executable","file-based-tasks"],"backgroundTag":"permission-denied","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"}