{"record":{"id":"b0c42ff034c422ea","repo":"nikivdev/code","slug":"config-path-not-found","errorCode":null,"errorMessage":"config path not found: {}","messagePattern":"config path not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lifecycle.rs","lineNumber":261,"sourceCode":"}\n\nfn resolve_project_config(config_arg: &Path) -> Result<ProjectConfig> {\n    let cwd = std::env::current_dir().context(\"Failed to read current directory\")?;\n    let flow_path = resolve_flow_path(config_arg, &cwd)?;\n    let cfg = config::load(&flow_path)\n        .with_context(|| format!(\"Failed to load {}\", flow_path.display()))?;\n    Ok(ProjectConfig {\n        flow_path,\n        config: cfg,\n    })\n}\n\nfn resolve_flow_path(config_arg: &Path, cwd: &Path) -> Result<PathBuf> {\n    if config_arg.is_absolute() {\n        if config_arg.exists() {\n            return Ok(config_arg.to_path_buf());\n        }\n        bail!(\"config path not found: {}\", config_arg.display());\n    }\n\n    let direct = cwd.join(config_arg);\n    if direct.exists() {\n        return Ok(direct);\n    }\n\n    if config_arg == Path::new(\"flow.toml\") {\n        if let Some(found) = find_flow_toml_upwards(cwd) {\n            return Ok(found);\n        }\n    }\n\n    bail!(\"config path not found: {}\", direct.display());\n}\n\nfn find_flow_toml_upwards(start: &Path) -> Option<PathBuf> {\n    let mut cur = start.to_path_buf();","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/lifecycle.rs#L243-L279","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Correct the absolute path passed to the config argument and re-run","Verify existence first: ls /path/to/flow.toml","Use a path relative to the project root (or just 'flow.toml') so resolution can walk upwards"],"exampleFix":"// before\nmytool lifecycle up --config /Users/me/proj/flow.toml  # file moved\n// after\nmytool lifecycle up --config /Users/me/proj/newproj/flow.toml","handlingStrategy":"validation","validationCode":"let p = std::path::Path::new(\"/Users/me/proj/flow.toml\");\nif !p.is_absolute() || !p.exists() {\n    eprintln!(\"config path missing: {}\", p.display());\n    std::process::exit(1);\n}","typeGuard":"fn config_exists(p: &std::path::Path) -> bool { p.is_absolute() && p.exists() }","tryCatchPattern":"match resolve_project_config(&args) {\n    Err(e) if e.to_string().starts_with(\"config path not found\") => {\n        eprintln!(\"Check the --config path exists (absolute) or run from the project root\");\n    }\n    other => other?,\n}","preventionTips":["Prefer relative 'flow.toml' resolution from the project root over absolute paths","Generate config paths dynamically instead of hardcoding machine-specific absolutes","Add a CI/setup check that the expected flow.toml path exists"],"tags":["config","filesystem","path-not-found"],"backgroundTag":"file-not-found","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}