{"record":{"id":"a3d7696542300436","repo":"gitbutlerapp/gitbutler","slug":"the-path-does-not-exist","errorCode":null,"errorMessage":"The path {} does not exist","messagePattern":"The path (.+?) does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/setup.rs","lineNumber":234,"sourceCode":"                writeln!(\n                    out,\n                    \"  {}\",\n                    t.success.paint(\"✓ Repository added to project registry\")\n                )?;\n            }\n            Ok(ProjectStatus::Added)\n        }\n        gitbutler_project::AddProjectOutcome::AlreadyExists(_) => {\n            if let Some(out) = out.for_human() {\n                writeln!(\n                    out,\n                    \"  {}\",\n                    t.success.paint(\"✓ Repository already in project registry\")\n                )?;\n            }\n            Ok(ProjectStatus::AlreadyExists)\n        }\n        gitbutler_project::AddProjectOutcome::PathNotFound => Err(anyhow::anyhow!(\n            \"The path {} does not exist\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::NotADirectory => Err(anyhow::anyhow!(\n            \"The path {} is not a directory\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::BareRepository => Err(anyhow::anyhow!(\n            \"The repository at {} is bare. GitButler requires a non-bare repository.\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::NonMainWorktree => Err(anyhow::anyhow!(\n            \"The repository at {} is a non-main worktree. GitButler requires the main worktree.\",\n            repo_path.display()\n        )),\n        gitbutler_project::AddProjectOutcome::NoWorkdir => Err(anyhow::anyhow!(\n            \"The repository at {} has no working directory. GitButler requires a working directory.\",\n            repo_path.display()","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/setup.rs#L216-L252","documentation":"Raised while registering a repository during `but setup`: the `gitbutler_project` crate validated the candidate path and returned `AddProjectOutcome::PathNotFound`, which the CLI maps to this error. It means the path does not exist on the filesystem at all, before any Git checks happen.","triggerScenarios":"Running the setup command with a path argument (or -C directory) that does not exist: a typo, a relative path resolved from the wrong cwd, or an unmounted volume.","commonSituations":"Typos in the path (`~/repso` vs `~/repos`); network mounts not yet mounted (macOS /Volumes/*, NFS/SMB shares); stale hard-coded paths in scripts after a directory moved.","solutions":["Check the path exists (`ls /the/path`) and fix the typo","Use an absolute path, or verify your cwd before using a relative one","If it is a mount point, remount it and rerun","If the directory is supposed to be new, create it and run `git init` inside it first, then rerun setup"],"exampleFix":"# before\nbut setup ~/repso/my-project\n\n# after\nbut setup ~/repos/my-project","handlingStrategy":"validation","validationCode":"match std::fs::metadata(&repo_path) {\n    Ok(_) => {}\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => {\n        anyhow::bail!(\"path {repo_path:?} does not exist; fix the path or mount\");\n    }\n    Err(e) => return Err(e.into()),\n}","typeGuard":"fn is_path_not_found(out: &gitbutler_project::AddProjectOutcome) -> bool {\n    matches!(out, gitbutler_project::AddProjectOutcome::PathNotFound)\n}","tryCatchPattern":"match add_project(&repo_path) {\n    Ok(out) if is_path_not_found(&out) => { /* tell the user the path is wrong */ }\n    Ok(out) => { /* handle other outcomes */ }\n    Err(err) if err.to_string().contains(\"does not exist\") => { /* path guidance */ }\n    Err(err) => return Err(err),\n}","preventionTips":["Use absolute paths in scripts and CI","Verify mounts exist before batch jobs that reference them","Run `test -d \"$PATH_ARG\"` guards before invoking setup commands"],"tags":["rust","cli","setup","path","filesystem"],"backgroundTag":"path-not-found","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}