plandex-ai/plandex · error
error getting pending build descriptions: %v
Error message
error getting pending build descriptions: %v
What it means
ActivePlan.PendingBuildsByPath loads the descriptions of the plan's conversation messages (db.GetConvoMessageDescriptions) to determine which builds are pending per file path. If that database lookup fails, the error is wrapped as 'error getting pending build descriptions: %v'. Called by queuePendingBuilds when planning a build cycle.
Source
Thrown at app/server/types/active_plan_pending_builds.go:14
package types
import (
"fmt"
"log"
"plandex-server/db"
shared "plandex-shared"
)
func (ap *ActivePlan) PendingBuildsByPath(orgId, userId string, convoMessagesArg []*db.ConvoMessage) (map[string][]*ActiveBuild, error) {
planDescs, err := db.GetConvoMessageDescriptions(orgId, ap.Id)
if err != nil {
return nil, fmt.Errorf("error getting pending build descriptions: %v", err)
}
if !HasPendingBuilds(planDescs) {
return map[string][]*ActiveBuild{}, nil
}
var convoMessages []*db.ConvoMessage
if convoMessagesArg == nil {
var err error
convoMessages, err = db.GetPlanConvo(orgId, ap.Id)
if err != nil {
return nil, fmt.Errorf("error getting plan convo: %v", err)
}
} else {
convoMessages = convoMessagesArg
}
View on GitHub (pinned to e2d772072e)
Solutions
- Check the wrapped '%v' cause for the underlying DB error and address it (connectivity, credentials, migrations)
- Verify the database is reachable and the convo_message_descriptions table exists/migrated
- Retry the build-queue operation; transient DB errors often resolve
- Confirm orgId and plan ID are correct and correspond to existing rows
Example fix
// before
builds, err := ap.PendingBuildsByPath(orgId, userId, msgs)
if err != nil {
return err
}
// after
builds, err := ap.PendingBuildsByPath(orgId, userId, msgs)
if err != nil {
log.Printf("pending builds lookup failed, retrying: %v", err)
time.Sleep(2 * time.Second)
builds, err = ap.PendingBuildsByPath(orgId, userId, msgs)
if err != nil {
return err
}
} Defensive patterns
Strategy: retry
Validate before calling
if err := db.Ping(ctx); err != nil {
return fmt.Errorf("db unavailable before build queue: %v", err)
}
if orgId == "" || ap.Id == "" {
return fmt.Errorf("orgId/planId required for pending builds")
} Try / catch
builds, err := ap.PendingBuildsByPath(orgId, userId, msgs)
if err != nil && strings.Contains(err.Error(), "error getting pending build descriptions") {
if isTransientDBError(err) {
time.Sleep(backoff)
builds, err = ap.PendingBuildsByPath(orgId, userId, msgs)
}
} Prevention
- Add retry with exponential backoff around DB lookups in the build queue
- Monitor DB health (connection pool saturation, statement timeouts) before queuing builds
- Run migrations so convo_message_descriptions exists
- Validate orgId/planId before querying
When it happens
Trigger: db.GetConvoMessageDescriptions(orgId, ap.Id) returns a DB error while queuePendingBuilds → PendingBuildsByPath computes pending builds — connection failure, timeout, missing rows/table, or permission issue on the descriptions store.
Common situations: Database down or unreachable (Postgres connection limits, network partition), org/plan ID mismatch causing query errors, migrations missing (table absent), transient deadlocks or statement timeouts under load.
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 storing plan build result: %v
- error getting plan modelContext: %v
- error getting pending builds by path: %v
- Error getting plan settings:
- Error getting org user config:
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/6f945111d24f164c.
Report an issue: GitHub.