jdx/mise · error
task {} was not found after marking {} as executable
Error message
task {} was not found after marking {} as executable What it means
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.
Source
Thrown at src/task/task_list.rs:261
return Ok(None);
}
let confirmed = config::Settings::get().yes
|| prompt::confirm("Mark this file as executable to allow it to be run as a task?")?
.is_yes();
if !confirmed {
return Ok(None);
}
file::make_executable(&path)?;
info!("marked as executable");
let all_tasks = config.reload_tasks_with_context(task_context).await?;
let tasks_with_aliases = crate::task::build_task_ref_map(all_tasks.iter());
let task = tasks_with_aliases
.get_matching(name)?
.into_iter()
.next()
.map(|task| (*task).clone());
ensure!(
task.is_some(),
"task {} was not found after marking {} as executable",
style::ered(name),
display_path(&path)
);
Ok(task)
}
async fn err_no_task(
config: &Arc<Config>,
name: &str,
task_context: Option<&TaskLoadContext>,
) -> Result<Option<Task>> {
// Check early if the name looks like a mistyped CLI subcommand
let similar_cmds = suggest_similar_commands(name);
let (tasks_for_error, showing_all_tasks) = tasks_for_missing_task_error(config, name).await?;
if tasks_for_error.is_empty() {View on GitHub (pinned to afd2eddd3a)
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
Example fix
// before mise run ./deploy.sh # not a registered task // after # .mise/tasks/deploy.sh (auto-discovered as task 'deploy') mise run deploy
Defensive patterns
Strategy: validation
Validate before calling
test -x "./script" && mise tasks ls | grep -q script && mise run script
Try / catch
mise run "$arg" || { mise tasks ls; exit 1; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Task not found: {task_spec}, use `mise tasks ls --all --hidd
- Task not found: {}, use `mise tasks ls --all --hidden` to li
- {} changed after permission planning; retry pull
- {} changed during application; left untouched
- brew-cask: temporary artifact directory is not private
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/30da0fba4e4d300a.
Report an issue: GitHub.