nikivdev/code · error

config path not found: {}

Error message

config path not found: {}

What it means

resolve_flow_path resolves the flow config path from an explicit argument. For absolute paths, if the path does not exist on disk it bails immediately with 'config path not found'. This is a fail-fast check before parsing the config.

Source

Thrown at src/lifecycle.rs:261

}

fn resolve_project_config(config_arg: &Path) -> Result<ProjectConfig> {
    let cwd = std::env::current_dir().context("Failed to read current directory")?;
    let flow_path = resolve_flow_path(config_arg, &cwd)?;
    let cfg = config::load(&flow_path)
        .with_context(|| format!("Failed to load {}", flow_path.display()))?;
    Ok(ProjectConfig {
        flow_path,
        config: cfg,
    })
}

fn resolve_flow_path(config_arg: &Path, cwd: &Path) -> Result<PathBuf> {
    if config_arg.is_absolute() {
        if config_arg.exists() {
            return Ok(config_arg.to_path_buf());
        }
        bail!("config path not found: {}", config_arg.display());
    }

    let direct = cwd.join(config_arg);
    if direct.exists() {
        return Ok(direct);
    }

    if config_arg == Path::new("flow.toml") {
        if let Some(found) = find_flow_toml_upwards(cwd) {
            return Ok(found);
        }
    }

    bail!("config path not found: {}", direct.display());
}

fn find_flow_toml_upwards(start: &Path) -> Option<PathBuf> {
    let mut cur = start.to_path_buf();

View on GitHub (pinned to a747e741ae)

Solutions

  1. Correct the absolute path passed to the config argument and re-run
  2. Verify existence first: ls /path/to/flow.toml
  3. Use a path relative to the project root (or just 'flow.toml') so resolution can walk upwards

Example fix

// before
mytool lifecycle up --config /Users/me/proj/flow.toml  # file moved
// after
mytool lifecycle up --config /Users/me/proj/newproj/flow.toml
Defensive patterns

Strategy: validation

Validate before calling

let p = std::path::Path::new("/Users/me/proj/flow.toml");
if !p.is_absolute() || !p.exists() {
    eprintln!("config path missing: {}", p.display());
    std::process::exit(1);
}

Type guard

fn config_exists(p: &std::path::Path) -> bool { p.is_absolute() && p.exists() }

Try / catch

match resolve_project_config(&args) {
    Err(e) if e.to_string().starts_with("config path not found") => {
        eprintln!("Check the --config path exists (absolute) or run from the project root");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Passing an absolute --config path (e.g. /etc/flow/flow.toml or /Users/me/proj/flow.toml) that does not exist to the lifecycle command (via resolve_project_config).

Common situations: Typo or wrong casing in an absolute path; file deleted/moved; using a path from another machine or container; hardcoding a path in a script that runs in a different environment.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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