nikivdev/code · error

deploy_task '{}' not found. Available tasks: {}

Error message

deploy_task '{}' not found. Available tasks: {}

What it means

run_with_project_context in src/deploy.rs was asked (via `f deploy <task>` or a fallback path) to run a deploy_task by name that is not defined in flow.toml. The error lists the tasks that ARE available (available_tasks(cfg)) so the caller can correct the name. It is thrown instead of silently guessing a task.

Source

Thrown at src/deploy.rs:347

        flow_config,
    } = ctx;

    match action {
        None => {
            // Auto-detect platform from flow.toml, or run deploy task if configured.
            if let Some(cfg) = flow_config.as_ref() {
                if let Some(task_name) = cfg.flow.deploy_task.as_deref() {
                    if tasks::find_task(cfg, task_name).is_some() {
                        return tasks::run(TaskRunOpts {
                            config: config_path,
                            delegate_to_hub: false,
                            hub_host: std::net::IpAddr::from([127, 0, 0, 1]),
                            hub_port: 9050,
                            name: task_name.to_string(),
                            args: Vec::new(),
                        });
                    }
                    bail!(
                        "deploy_task '{}' not found. Available tasks: {}",
                        task_name,
                        available_tasks(cfg)
                    );
                }

                if cfg.host.is_some() || cfg.cloudflare.is_some() || cfg.railway.is_some() {
                    return auto_deploy(&project_root, Some(cfg));
                }
                if tasks::find_task(cfg, "deploy").is_some() {
                    return tasks::run(TaskRunOpts {
                        config: config_path,
                        delegate_to_hub: false,
                        hub_host: std::net::IpAddr::from([127, 0, 0, 1]),
                        hub_port: 9050,
                        name: "deploy".to_string(),
                        args: Vec::new(),
                    });

View on GitHub (pinned to a747e741ae)

Solutions

  1. Read the 'Available tasks:' list in the error and re-run with an exact task name.
  2. Add the missing task to flow.toml, e.g. `[deploy_task.mytask]` with the desired command.
  3. Run `f deploy` with no task to use the default deploy path instead of a named task.

Example fix

# before
$ f deploy deply-staging
deploy_task 'deply-staging' not found. Available tasks: deploy-staging
# after
$ f deploy deploy-staging
Defensive patterns

Strategy: validation

Validate before calling

// Shell: list tasks and verify the name exists before invoking
TASKS=$(grep -E '^\[deploy_task\.' flow.toml | sed 's/\[deploy_task\.\(.*\)\]/\1/')
echo "$TASKS" | grep -qx "$1" || { echo "task '$1' not in flow.toml; available: $TASKS"; exit 1; }

Prevention

When it happens

Trigger: Invoking `f deploy <name>` where <name> matches no [deploy_task.<name>] entry in flow.toml; typo in the task name; task defined in a different config file or removed in a refactor.

Common situations: Typo like `f deploy produtcion`; following old docs before the task was renamed; working in a repo copy where flow.toml lacks the custom task a teammate defined locally.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/4622a36d722a3cbe. Report an issue: GitHub.