{"record":{"id":"6f945111d24f164c","repo":"plandex-ai/plandex","slug":"error-getting-pending-build-descriptions-v-6f9451","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/types/active_plan_pending_builds.go","lineNumber":14,"sourceCode":"package types\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"plandex-server/db\"\n\n\tshared \"plandex-shared\"\n)\n\nfunc (ap *ActivePlan) PendingBuildsByPath(orgId, userId string, convoMessagesArg []*db.ConvoMessage) (map[string][]*ActiveBuild, error) {\n\tplanDescs, err := db.GetConvoMessageDescriptions(orgId, ap.Id)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting pending build descriptions: %v\", err)\n\t}\n\n\tif !HasPendingBuilds(planDescs) {\n\t\treturn map[string][]*ActiveBuild{}, nil\n\t}\n\n\tvar convoMessages []*db.ConvoMessage\n\tif convoMessagesArg == nil {\n\t\tvar err error\n\t\tconvoMessages, err = db.GetPlanConvo(orgId, ap.Id)\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error getting plan convo: %v\", err)\n\t\t}\n\t} else {\n\t\tconvoMessages = convoMessagesArg\n\t}\n","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/types/active_plan_pending_builds.go#L1-L32","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nbuilds, err := ap.PendingBuildsByPath(orgId, userId, msgs)\nif err != nil {\n    return err\n}\n// after\nbuilds, err := ap.PendingBuildsByPath(orgId, userId, msgs)\nif err != nil {\n    log.Printf(\"pending builds lookup failed, retrying: %v\", err)\n    time.Sleep(2 * time.Second)\n    builds, err = ap.PendingBuildsByPath(orgId, userId, msgs)\n    if err != nil {\n        return err\n    }\n}","handlingStrategy":"retry","validationCode":"if err := db.Ping(ctx); err != nil {\n    return fmt.Errorf(\"db unavailable before build queue: %v\", err)\n}\nif orgId == \"\" || ap.Id == \"\" {\n    return fmt.Errorf(\"orgId/planId required for pending builds\")\n}","typeGuard":null,"tryCatchPattern":"builds, err := ap.PendingBuildsByPath(orgId, userId, msgs)\nif err != nil && strings.Contains(err.Error(), \"error getting pending build descriptions\") {\n    if isTransientDBError(err) {\n        time.Sleep(backoff)\n        builds, err = ap.PendingBuildsByPath(orgId, userId, msgs)\n    }\n}","preventionTips":["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"],"tags":["database","plandex","build-queue","db-query"],"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"}