{"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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/legacy/setup.rs","lineNumber":253,"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":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/setup.rs#L235-L271","documentation":"Thrown by the `but setup` command when adding a project to the project registry fails with `AddProjectOutcome::PathNotFound`. GitButler checked the given path on disk and could not find it at all, so it refuses to register the repository. The error message interpolates the offending path via `repo_path.display()`.","triggerScenarios":"Running `but setup` (or the legacy add-project flow) with a repo path that does not exist on disk; the project-registry add call returns AddProjectOutcome::PathNotFound.","commonSituations":"Typo in the path passed to setup; running setup from a directory that was moved, renamed, or deleted; using a relative path from the wrong working directory; stale config pointing at a removed clone.","solutions":["Verify the path exists: run `ls <path>` (or `test -d <path>`) and correct any typo.","Re-run `but setup` from inside the repository or pass its absolute path.","If the repo was moved or deleted, re-clone or update the stored path before setup."],"exampleFix":"// before\nbut setup ~/projcts/myrepo\n// after\nbut setup ~/projects/myrepo","handlingStrategy":"validation","validationCode":"const path = repoPath;\nif (!fs.existsSync(path)) {\n  throw new Error(`Fix path before running but setup: ${path} does not exist`);\n}","typeGuard":"function isExistingPath(p: string): boolean {\n  try { return fs.existsSync(p); } catch { return false; }\n}","tryCatchPattern":"try {\n  await run(['but', 'setup', repoPath]);\n} catch (e) {\n  if (String(e).includes('does not exist')) {\n    console.error(`Path ${repoPath} not found; check spelling and that the clone still exists.`);\n  }\n  throw e;\n}","preventionTips":["Always pass absolute paths to but setup.","Verify the clone exists with `test -d <path>` in scripts before invoking setup.","Keep a single source of truth for repo locations to avoid stale paths."],"tags":["filesystem","cli","path-not-found","setup"],"backgroundTag":"file-not-found","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}