{"record":{"id":"69e51f8a917f9174","repo":"plandex-ai/plandex","slug":"error-rejecting-all-changes","errorCode":null,"errorMessage":"Error rejecting all changes: ","messagePattern":"Error rejecting all changes: ","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/handlers/plans_changes.go","lineNumber":295,"sourceCode":"\t\tCancelFn:       cancel,\n\t\tClearRepoOnErr: true,\n\t}, func(repo *db.GitRepo) error {\n\t\terr := db.RejectAllResults(auth.OrgId, planId)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\terr = repo.GitAddAndCommit(branch, \"🚫 Rejected all pending changes\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error committing rejected changes: %v\", err)\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tif err != nil {\n\t\tlog.Printf(\"Error rejecting all changes: %v\\n\", err)\n\t\thttp.Error(w, \"Error rejecting all changes: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tlog.Println(\"Successfully rejected all changes for plan\", planId)\n}\n\nfunc RejectFileHandler(w http.ResponseWriter, r *http.Request) {\n\tlog.Println(\"Received request for RejectFileHandler\")\n\n\tauth := Authenticate(w, r, true)\n\tif auth == nil {\n\t\treturn\n\t}\n\n\tvars := mux.Vars(r)\n\tplanId := vars[\"planId\"]\n\tbranch := vars[\"branch\"]\n","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/plans_changes.go#L277-L313","documentation":"RejectAllChangesHandler failed inside its write-lock ExecRepoOperation: db.RejectAllResults (deleting pending results) or repo.GitAddAndCommit (committing the rejection) returned an error. The handler responds 500 'Error rejecting all changes: <detail>' and the repo is cleared on error (ClearRepoOnErr) to avoid a corrupt state.","triggerScenarios":"RejectAllResults DB delete fails; GitAddAndCommit fails due to missing git identity, dirty index, stale lock files, or branch checkout problems; lock held by another operation; context cancelled mid-operation.","commonSituations":"Server container missing git user.name/user.email config; leftover .git/index.lock after a crash; concurrent apply in flight; Postgres outage during the delete.","solutions":["Read the appended error detail to see whether the DB delete or git commit failed","If git identity is unconfigured, set user.name/user.email in the server environment","Remove stale lock files (index.lock) from the plan repo and retry","Wait for any in-flight apply/other operation to release the plan lock, then retry"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"const res = await fetch(rejectAllUrl, {method: 'POST'});\nif (res.status === 500 && (await res.text()).includes('Error rejecting all changes')) {\n  // DB delete or git commit failed: inspect detail, clear locks, retry\n}","preventionTips":["Configure git user.name/user.email in the server container","Clean stale .git lock files after any server crash","Avoid rejecting while an apply is in flight on the same plan/branch","Monitor Postgres health before bulk reject operations"],"tags":["git","database","reject","http"],"backgroundTag":"git-commit-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}