plandex-ai/plandex · error
error getting pending build descriptions: %v
Error message
error getting pending build descriptions: %v
What it means
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'.
Source
Thrown at app/server/model/plan/build_finish.go:79
log.Println("Locking repo for finished build")
err := db.ExecRepoOperation(db.ExecRepoOperationParams{
OrgId: currentOrgId,
UserId: currentUserId,
PlanId: planId,
Branch: branch,
PlanBuildId: build.Id,
Scope: db.LockScopeWrite,
Ctx: ap.Ctx,
CancelFn: ap.CancelFn,
Reason: "finish build",
}, func(repo *db.GitRepo) error {
// get plan descriptions
var planDescs []*db.ConvoMessageDescription
planDescs, err := db.GetConvoMessageDescriptions(currentOrgId, planId)
if err != nil {
log.Printf("Error getting pending build descriptions: %v\n", err)
return fmt.Errorf("error getting pending build descriptions: %v", err)
}
var unbuiltDescs []*db.ConvoMessageDescription
for _, desc := range planDescs {
if !desc.DidBuild || len(desc.BuildPathsInvalidated) > 0 {
unbuiltDescs = append(unbuiltDescs, desc)
}
}
// get fresh current plan state
var currentPlan *shared.CurrentPlanState
currentPlan, err = db.GetCurrentPlanState(db.CurrentPlanStateParams{
OrgId: currentOrgId,
PlanId: planId,
ConvoMessageDescriptions: planDescs,
})
if err != nil {
log.Printf("Error getting current plan state: %v\n", err)View on GitHub (pinned to e2d772072e)
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
Example fix
null
Defensive patterns
Strategy: retry
Validate before calling
// before finishing the build, verify DB reachability and plan presence
if err := db.Ping(); err != nil { return err }
if _, err := db.GetPlan(orgId, planId); err != nil { return err } Try / catch
planDescs, err := db.GetConvoMessageDescriptions(orgId, planId)
if err != nil {
return fmt.Errorf("error getting pending build descriptions: %w", err)
}
// retry with backoff on transient DB errors (e.g. pq: connection reset) Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- error getting current plan state: %v
- error invalidating conflicted results: %v
- error adding plan context tokens: %v
- error adding org member: %v
- error listing org roles: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/e79d417f9964f355.
Report an issue: GitHub.