{"record":{"id":"f4fb0024055ac7f1","repo":"jdx/mise","slug":"task-not-found-task-spec-use-mise-tasks-ls","errorCode":null,"errorMessage":"Task not found: {task_spec}, use `mise tasks ls --all --hidden` to list all tasks","messagePattern":"Task not found: (.+?), use `mise tasks ls --all --hidden` to list all tasks","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/cache/task.rs","lineNumber":129,"sourceCode":"    let config = Config::get().await?;\n    let task_name = crate::task::expand_colon_task_syntax(task_spec, &config)?;\n    let tasks = if task_name.starts_with(\"//\") {\n        let ctx = crate::task::TaskLoadContext::from_pattern(&task_name);\n        config.tasks_with_context(Some(&ctx)).await?\n    } else if crate::task::is_workspace_project_task(&task_name) {\n        let ctx = crate::task::TaskLoadContext::all();\n        config.tasks_with_context(Some(&ctx)).await?\n    } else {\n        config.tasks().await?\n    };\n    let tasks_with_aliases = crate::task::build_task_ref_map(tasks.iter());\n    let mut tasks = tasks_with_aliases\n        .get_matching(&task_name)?\n        .into_iter()\n        .map(|task| (**task).clone())\n        .collect_vec();\n    if tasks.is_empty() {\n        bail!(\"Task not found: {task_spec}, use `mise tasks ls --all --hidden` to list all tasks\");\n    }\n    TaskFetcher::new(false)\n        .fetch_tasks(&config, &mut tasks)\n        .await?;\n    Ok((config, tasks))\n}\n\nfn format_timestamp(timestamp: u64) -> String {\n    i64::try_from(timestamp)\n        .ok()\n        .and_then(|timestamp| DateTime::<Utc>::from_timestamp(timestamp, 0))\n        .map(|timestamp| timestamp.to_rfc3339_opts(SecondsFormat::Secs, true))\n        .unwrap_or_else(|| \"unknown\".to_string())\n}\n","sourceCodeStart":111,"sourceCodeEnd":144,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/cache/task.rs#L111-L144","documentation":"resolve_tasks (src/cli/cache/task.rs:129) is the task resolver behind 'mise cache task': it expands colon syntax (//workspace and project tasks), loads all tasks plus aliases via build_task_ref_map, and if get_matching() yields nothing for the spec it bails, pointing at 'mise tasks ls --all --hidden' to enumerate what actually loaded.","triggerScenarios":"'mise cache task <name> <cmd>' where <name> is not defined in mise.toml [tasks], tasks/ files, or plugins; running outside the project so no tasks load; a workspace task referenced without the // prefix; a typo or a removed alias.","commonSituations":"Running from a subdirectory or the wrong repo; task files with invalid TOML that load zero tasks; renamed or deleted tasks; monorepo tasks addressed with the wrong prefix.","solutions":["Run 'mise tasks ls --all --hidden' and copy the exact name (the error suggests this)","Run from the project root, or use the // form for workspace tasks: 'mise cache task //pkg:build ...'","Verify the task file parses and is discovered: 'mise tasks ls' should list it; fix TOML errors","Check aliases: the spec must match the task name or one of its aliases"],"exampleFix":"# before\nmise cache task biuld warm\n# Error: Task not found: biuld, use `mise tasks ls --all --hidden` to list all tasks\n\n# after\nmise tasks ls --all --hidden\nmise cache task build warm","handlingStrategy":"validation","validationCode":"# bash: assert the task exists before warming its cache\nmise tasks ls --all --hidden 2>/dev/null | awk '{print $1}' | grep -qx \"$TASK\" || { echo \"task not found: $TASK\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run task scripts from the project root","Use the //workspace prefix for monorepo tasks","Validate task names in CI before cache-warm steps"],"tags":["mise","tasks","task-resolution","cache"],"backgroundTag":"task-not-found","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}