{"record":{"id":"30da0fba4e4d300a","repo":"jdx/mise","slug":"task-was-not-found-after-marking-as-executab","errorCode":null,"errorMessage":"task {} was not found after marking {} as executable","messagePattern":"task (.+?) was not found after marking (.+?) as executable","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_list.rs","lineNumber":261,"sourceCode":"        return Ok(None);\n    }\n    let confirmed = config::Settings::get().yes\n        || prompt::confirm(\"Mark this file as executable to allow it to be run as a task?\")?\n            .is_yes();\n    if !confirmed {\n        return Ok(None);\n    }\n\n    file::make_executable(&path)?;\n    info!(\"marked as executable\");\n    let all_tasks = config.reload_tasks_with_context(task_context).await?;\n    let tasks_with_aliases = crate::task::build_task_ref_map(all_tasks.iter());\n    let task = tasks_with_aliases\n        .get_matching(name)?\n        .into_iter()\n        .next()\n        .map(|task| (*task).clone());\n    ensure!(\n        task.is_some(),\n        \"task {} was not found after marking {} as executable\",\n        style::ered(name),\n        display_path(&path)\n    );\n    Ok(task)\n}\n\nasync fn err_no_task(\n    config: &Arc<Config>,\n    name: &str,\n    task_context: Option<&TaskLoadContext>,\n) -> Result<Option<Task>> {\n    // Check early if the name looks like a mistyped CLI subcommand\n    let similar_cmds = suggest_similar_commands(name);\n    let (tasks_for_error, showing_all_tasks) = tasks_for_missing_task_error(config, name).await?;\n\n    if tasks_for_error.is_empty() {","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/task/task_list.rs#L243-L279","documentation":"After making a task file executable (chmod +x), mise re-resolves the task by name including aliases; if the task still can't be found, it raises this error referencing the file path. It indicates the executable file wasn't recognized as a task after chmod.","triggerScenarios":"make_task_executable chmods a non-task script (or a script mise can't parse/associate with a task), then err_no_task re-looks-up the name and finds nothing — e.g. running `mise run ./some-script.sh` where the file isn't a registered task.","commonSituations":"Running a raw script path that is not a mise task; task file lacks a recognized task header/shebang pattern mise expects; file is outside configured task file globs.","solutions":["Define the file as a task (add it under [tasks] in mise.toml or place it in the configured task file location, e.g. .mise/tasks/)","Check `mise tasks ls` to confirm the task name is registered","Use `mise exec -- ./script.sh` for plain scripts that aren't tasks","Verify task file globs/settings include the file's directory"],"exampleFix":"// before\nmise run ./deploy.sh        # not a registered task\n// after\n# .mise/tasks/deploy.sh  (auto-discovered as task 'deploy')\nmise run deploy","handlingStrategy":"validation","validationCode":"test -x \"./script\" && mise tasks ls | grep -q script && mise run script","typeGuard":null,"tryCatchPattern":"mise run \"$arg\" || { mise tasks ls; exit 1; }","preventionTips":["Only pass registered task names to `mise run`; use `mise exec --` for plain scripts","Keep task files in directories covered by mise task discovery (.mise/tasks/)","Verify with `mise tasks ls` after adding new task files"],"tags":["tasks","filesystem","permissions","not-found"],"backgroundTag":"resource-not-found","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"}