nikivdev/code · error
No lifecycle up task found. Define task 'up' or 'dev', or se
Error message
No lifecycle up task found. Define task 'up' or 'dev', or set [lifecycle].up_task in {} What it means
run_up looks for the project's 'up' lifecycle action: an explicit [lifecycle].up_task, or a task named 'up' or 'dev' in flow.toml. If none of these exist, it bails telling the developer where the config lives and what to define. It is a config-completeness check, not a task execution failure.
Source
Thrown at src/lifecycle.rs:43
eprintln!(
"WARN lifecycle domains unavailable; continuing without localhost routing"
);
eprintln!("WARN {}", err);
None
}
}
} else {
None
};
let _preferred_url_guard = ScopedPreferredUrl::set(preferred_url);
let ran_task = match lifecycle.up_task.as_deref() {
Some(task) => run_required_task(&project.flow_path, task, opts.args)?,
None => run_optional_task_chain(&project.flow_path, &["up", "dev"], opts.args)?,
};
if !ran_task {
bail!(
"No lifecycle up task found. Define task 'up' or 'dev', or set [lifecycle].up_task in {}",
project.flow_path.display()
);
}
Ok(())
}
pub fn run_down(opts: LifecycleRunOpts) -> Result<()> {
let project = resolve_project_config(&opts.config)?;
let lifecycle = project.config.lifecycle.clone().unwrap_or_default();
let mut task_ran = match lifecycle.down_task.as_deref() {
Some(task) => run_required_task(&project.flow_path, task, opts.args.clone())?,
None => run_optional_task_chain(&project.flow_path, &["down"], opts.args.clone())?,
};
if !task_ran && lifecycle.down_task.is_none() {View on GitHub (pinned to a747e741ae)
Solutions
- Add an `up` (or `dev`) task to flow.toml under [tasks]
- Or set an explicit task in flow.toml: [lifecycle] up_task = "start"
- Confirm the correct flow.toml is being resolved (the path in the message) and that the task names match
Example fix
// before (flow.toml) [tasks] start = "docker compose up -d" // after [tasks] start = "docker compose up -d" [lifecycle] up_task = "start"
Defensive patterns
Strategy: validation
Validate before calling
let cfg = std::fs::read_to_string("flow.toml")?;
let has_up = cfg.contains("[lifecycle]") && cfg.contains("up_task")
|| cfg.lines().any(|l| l.starts_with("up ") || l.starts_with("dev "));
if !has_up { eprintln!("flow.toml defines no up/dev task or up_task"); } Try / catch
if let Err(e) = run_up(&project, opts) {
if e.to_string().contains("No lifecycle up task found") {
eprintln!("Add an 'up' or 'dev' task, or [lifecycle].up_task, to flow.toml");
}
return Err(e);
} Prevention
- Always define an 'up' task in new project flow.toml templates
- Keep task names in [lifecycle] in sync with [tasks] entries
- Run lifecycle up from the project root so the right flow.toml is resolved
When it happens
Trigger: Running the up lifecycle command against a project whose flow.toml has no [lifecycle].up_task setting and defines neither an 'up' nor a 'dev' task.
Common situations: New project with a minimal flow.toml lacking lifecycle tasks; task renamed (e.g. 'start' instead of 'up'/'dev') without setting up_task; running up in the wrong directory so the wrong/default flow.toml is picked up.
Related errors
- No lifecycle down action found. Define task 'down', set [lif
- lifecycle task '{}' not found
- invalid lifecycle.domains.engine '{}': expected 'docker' or
- lifecycle.domains.aliases[].host is required
- lifecycle.domains.aliases[].target is required
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/56e02bad4e3a0a25.
Report an issue: GitHub.