{"record":{"id":"56e02bad4e3a0a25","repo":"nikivdev/code","slug":"no-lifecycle-up-task-found-define-task-up-or-d","errorCode":null,"errorMessage":"No lifecycle up task found. Define task 'up' or 'dev', or set [lifecycle].up_task in {}","messagePattern":"No lifecycle up task found\\. Define task 'up' or 'dev', or set \\[lifecycle\\]\\.up_task in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lifecycle.rs","lineNumber":43,"sourceCode":"                eprintln!(\n                    \"WARN lifecycle domains unavailable; continuing without localhost routing\"\n                );\n                eprintln!(\"WARN {}\", err);\n                None\n            }\n        }\n    } else {\n        None\n    };\n    let _preferred_url_guard = ScopedPreferredUrl::set(preferred_url);\n\n    let ran_task = match lifecycle.up_task.as_deref() {\n        Some(task) => run_required_task(&project.flow_path, task, opts.args)?,\n        None => run_optional_task_chain(&project.flow_path, &[\"up\", \"dev\"], opts.args)?,\n    };\n\n    if !ran_task {\n        bail!(\n            \"No lifecycle up task found. Define task 'up' or 'dev', or set [lifecycle].up_task in {}\",\n            project.flow_path.display()\n        );\n    }\n\n    Ok(())\n}\n\npub fn run_down(opts: LifecycleRunOpts) -> Result<()> {\n    let project = resolve_project_config(&opts.config)?;\n    let lifecycle = project.config.lifecycle.clone().unwrap_or_default();\n\n    let mut task_ran = match lifecycle.down_task.as_deref() {\n        Some(task) => run_required_task(&project.flow_path, task, opts.args.clone())?,\n        None => run_optional_task_chain(&project.flow_path, &[\"down\"], opts.args.clone())?,\n    };\n\n    if !task_ran && lifecycle.down_task.is_none() {","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/lifecycle.rs#L25-L61","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (flow.toml)\n[tasks]\nstart = \"docker compose up -d\"\n// after\n[tasks]\nstart = \"docker compose up -d\"\n[lifecycle]\nup_task = \"start\"","handlingStrategy":"validation","validationCode":"let cfg = std::fs::read_to_string(\"flow.toml\")?;\nlet has_up = cfg.contains(\"[lifecycle]\") && cfg.contains(\"up_task\")\n    || cfg.lines().any(|l| l.starts_with(\"up \") || l.starts_with(\"dev \"));\nif !has_up { eprintln!(\"flow.toml defines no up/dev task or up_task\"); }","typeGuard":null,"tryCatchPattern":"if let Err(e) = run_up(&project, opts) {\n    if e.to_string().contains(\"No lifecycle up task found\") {\n        eprintln!(\"Add an 'up' or 'dev' task, or [lifecycle].up_task, to flow.toml\");\n    }\n    return Err(e);\n}","preventionTips":["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"],"tags":["config","lifecycle","missing-task"],"backgroundTag":"missing-config-task","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}