jdx/mise · error
executor must be initialized before running tasks
Error message
executor must be initialized before running tasks
What it means
`run_task_sched` forwards each scheduled task to the `TaskExecutor`, which `run` creates during setup. The `.expect()` panics if `self.executor` is `None`, meaning the scheduler is being driven without the initialization step that `run` performs. This is a programming-invariant guard, not a user-facing error.
Solutions
- Run `MISE_DEBUG=1 mise <cmd>` and report the panic with the trace to the mise repository
- Ensure your command flows through the normal `Run` command implementation rather than hand-building the runner
- Call `setup_executor()` before any scheduling in custom code paths
- Update to the latest mise version to rule out a fixed regression
Example fix
// before
self.executor.as_ref().expect("executor must be initialized before running tasks").run_task_sched(ctx).await
// after
let executor = self.executor.as_ref()
.ok_or_else(|| eyre!("internal error: executor not initialized"))?;
executor.run_task_sched(ctx).await Defensive patterns
Strategy: validation
Validate before calling
// Before scripting around mise, verify the command works normally: mise run --dry-run <task> || echo "scheduler path broken; update mise"
Prevention
- Drive task execution only through the public `mise run` CLI
- In forked/patched builds, always call `setup_executor()` before scheduling
- Pin a known-good mise version in CI
When it happens
Trigger: Invoking the scheduler callback `run_task_sched` from a code path that never called `setup_executor()`; constructing the runner struct manually in tests or new commands without initialization; an early-return bug in setup that still lets scheduling begin.
Common situations: Contributors adding a new subcommand that reuses the task scheduler but forgets the executor setup step; test harnesses constructing the runner directly.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- task executor initialized
- artifact directory was initialized
- command wait must complete
- executor must be initialized before displaying cache stats
- generated mise usage spec
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/c8dbb02ef2d0d6ef.
Report an issue: GitHub.
Appendix: source
Thrown at src/cli/run.rs:1376
.executor
.as_ref()
.map(|e| e.is_interrupted())
.unwrap_or(false)
}
fn mark_interrupted(&self) {
if let Some(executor) = &self.executor {
executor.mark_interrupted();
}
}
async fn run_task_sched(
&self,
ctx: TaskRunContext<'_>,
) -> Result<crate::task::task_executor::TaskRunOutcome> {
self.executor
.as_ref()
.expect("executor must be initialized before running tasks")
.run_task_sched(ctx)
.await
}
fn add_failed_task(&self, task: Task, status: Option<i32>) {
if let Some(executor) = &self.executor {
executor.add_failed_task(task, status);
}
}
fn validate_task(&self, task: &Task) -> Result<()> {
use crate::file;
use crate::ui;
if self.task_cache.enabled() && task.cache.as_ref().is_some_and(|cache| cache.enabled) {
Settings::get().ensure_experimental("task artifact caching")?;
}
if task.rust_cache.as_ref().is_some_and(|cache| cache.enabled) {
deprecated_at!(View on GitHub (pinned to afd2eddd3a)