{"record":{"id":"6afe812e03499f2e","repo":"plandex-ai/plandex","slug":"error-getting-project-paths-v","errorCode":null,"errorMessage":"error getting project paths: %v","messagePattern":"error getting project paths: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/plan_exec/build.go","lineNumber":37,"sourceCode":"\tterm.StartSpinner(\"\")\n\n\terr := PromptSyncModelsIfNeeded()\n\tif err != nil {\n\t\tterm.OutputErrorAndExit(\"Error syncing models: %v\", err)\n\t}\n\n\tterm.StartSpinner(\"\")\n\n\tcontexts, apiErr := api.Client.ListContext(params.CurrentPlanId, params.CurrentBranch)\n\n\tif apiErr != nil {\n\t\tterm.OutputErrorAndExit(\"Error getting context: %v\", apiErr)\n\t}\n\n\tpaths, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))\n\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"error getting project paths: %v\", err)\n\t}\n\n\tanyOutdated, didUpdate, err := params.CheckOutdatedContext(contexts, paths)\n\n\tif err != nil {\n\t\tterm.OutputErrorAndExit(\"error checking outdated context: %v\", err)\n\t}\n\n\tif anyOutdated && !didUpdate {\n\t\tterm.StopSpinner()\n\t\tlog.Println(\"Build canceled\")\n\t\treturn false, nil\n\t}\n\n\tapiErr = api.Client.BuildPlan(params.CurrentPlanId, params.CurrentBranch, shared.BuildPlanRequest{\n\t\tConnectStream: !buildBg,\n\t\tProjectPaths:  paths.ActivePaths,\n\t\tAuthVars:      params.AuthVars,","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/plan_exec/build.go#L19-L55","documentation":"Build wraps any error returned by fs.GetProjectPaths when resolving the base directory for the current contexts. It means the CLI could not determine where project files (contexts, plan files) live, so it cannot proceed to check outdated contexts or build. The underlying cause (path resolution or stat failure) is embedded in the message.","triggerScenarios":"Calling Build when fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts)) returns an error — typically the base directory does not exist, cannot be created, or a path component cannot be resolved for the given contexts.","commonSituations":"Running plandex from a directory that was deleted or renamed after session start; context referencing a project root that was moved; permission problems in $HOME or project dir.","solutions":["Verify the current working directory exists and is readable (pwd, ls)","Re-create the project base directory or re-init the project","Check permissions on the project directory","Reopen the session from the correct project root"],"exampleFix":"// before\npaths, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))\n// after\nbaseDir := fs.GetBaseDirForContexts(contexts)\nif _, err := os.Stat(baseDir); os.IsNotExist(err) {\n    os.MkdirAll(baseDir, 0755)\n}\npaths, err := fs.GetProjectPaths(baseDir)","handlingStrategy":"validation","validationCode":"baseDir := fs.GetBaseDirForContexts(contexts)\nif _, err := os.Stat(baseDir); err != nil {\n    // recreate or abort before calling Build\n    os.MkdirAll(baseDir, 0755)\n}","typeGuard":"func projectPathsOk(baseDir string) bool {\n    info, err := os.Stat(baseDir)\n    return err == nil && info.IsDir()\n}","tryCatchPattern":"_, err := Build(params)\nif err != nil && strings.HasPrefix(err.Error(), \"error getting project paths\") {\n    // recover: reinit project dirs or cd back to project root\n    return fmt.Errorf(\"project directory missing: %w\", err)\n}","preventionTips":["Don't rename/delete the project root while a session is open","Re-open plandex from the project root after moving the repo","Keep $HOME and project dirs writable","Re-init the project if base dir metadata is stale"],"tags":["filesystem","paths","project-setup"],"backgroundTag":"missing-project-directory","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}