{"record":{"id":"e79d417f9964f355","repo":"plandex-ai/plandex","slug":"error-getting-pending-build-descriptions-v","errorCode":null,"errorMessage":"error getting pending build descriptions: %v","messagePattern":"error getting pending build descriptions: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/model/plan/build_finish.go","lineNumber":79,"sourceCode":"\tlog.Println(\"Locking repo for finished build\")\n\n\terr := db.ExecRepoOperation(db.ExecRepoOperationParams{\n\t\tOrgId:       currentOrgId,\n\t\tUserId:      currentUserId,\n\t\tPlanId:      planId,\n\t\tBranch:      branch,\n\t\tPlanBuildId: build.Id,\n\t\tScope:       db.LockScopeWrite,\n\t\tCtx:         ap.Ctx,\n\t\tCancelFn:    ap.CancelFn,\n\t\tReason:      \"finish build\",\n\t}, func(repo *db.GitRepo) error {\n\t\t// get plan descriptions\n\t\tvar planDescs []*db.ConvoMessageDescription\n\t\tplanDescs, err := db.GetConvoMessageDescriptions(currentOrgId, planId)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error getting pending build descriptions: %v\\n\", err)\n\t\t\treturn fmt.Errorf(\"error getting pending build descriptions: %v\", err)\n\t\t}\n\n\t\tvar unbuiltDescs []*db.ConvoMessageDescription\n\t\tfor _, desc := range planDescs {\n\t\t\tif !desc.DidBuild || len(desc.BuildPathsInvalidated) > 0 {\n\t\t\t\tunbuiltDescs = append(unbuiltDescs, desc)\n\t\t\t}\n\t\t}\n\n\t\t// get fresh current plan state\n\t\tvar currentPlan *shared.CurrentPlanState\n\t\tcurrentPlan, err = db.GetCurrentPlanState(db.CurrentPlanStateParams{\n\t\t\tOrgId:                    currentOrgId,\n\t\t\tPlanId:                   planId,\n\t\t\tConvoMessageDescriptions: planDescs,\n\t\t})\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error getting current plan state: %v\\n\", err)","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/build_finish.go#L61-L97","documentation":"Raised inside the write-locked repo operation of onFinishBuild when db.GetConvoMessageDescriptions(orgId, planId) fails to load the plan's conversation message descriptions. These descriptions drive which pending changes are committed as part of finishing the build, so the whole repo operation aborts with 'error getting pending build descriptions: %v'.","triggerScenarios":"onFinishBuild after all files in a build complete -> ExecRepoOperation callback -> GetConvoMessageDescriptions returns an error: database unavailable, org/plan id mismatch, or query failure on the convo_message_descriptions table.","commonSituations":"Postgres down or connection pool exhausted at build finish; plan/org ID inconsistencies after a fork or import; DB schema drift after upgrading the app without running migrations.","solutions":["Check DB connectivity and server logs for the underlying wrapped error","Retry the build finish — transient connection failures are the usual cause","Verify the org/plan IDs are correct and the plan still exists","Ensure DB migrations are up to date for the descriptions table","If stuck, re-trigger plan build finish by rebuilding or restarting the plan session"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// before finishing the build, verify DB reachability and plan presence\nif err := db.Ping(); err != nil { return err }\nif _, err := db.GetPlan(orgId, planId); err != nil { return err }","typeGuard":null,"tryCatchPattern":"planDescs, err := db.GetConvoMessageDescriptions(orgId, planId)\nif err != nil {\n    return fmt.Errorf(\"error getting pending build descriptions: %w\", err)\n}\n// retry with backoff on transient DB errors (e.g. pq: connection reset)","preventionTips":["Run DB migrations on every deploy","Add connection-pool health checks before long repo operations","Use %w wrapping so callers can errors.Is/As on the cause","Alert on DB connection errors to catch outages before builds finish"],"tags":["go","database","build"],"backgroundTag":"database-query-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"}