{"record":{"id":"48ae3d4e5706499b","repo":"plandex-ai/plandex","slug":"error-getting-plan-summaries","errorCode":null,"errorMessage":"Error getting plan summaries: ","messagePattern":"Error getting plan summaries: ","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/handlers/plans_convo.go","lineNumber":144,"sourceCode":"\t\thttp.Error(w, \"Error getting plan convo: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif len(convoMessages) == 0 {\n\t\tlog.Println(\"No messages found for plan\")\n\t\treturn\n\t}\n\n\tconvoMessageIds := make([]string, len(convoMessages))\n\tfor i, convoMessage := range convoMessages {\n\t\tconvoMessageIds[i] = convoMessage.Id\n\t}\n\n\tsummmaries, err := db.GetPlanSummaries(planId, convoMessageIds)\n\n\tif err != nil {\n\t\tlog.Println(\"Error getting plan summaries: \", err)\n\t\thttp.Error(w, \"Error getting plan summaries: \"+err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tif len(summmaries) == 0 {\n\t\tlog.Println(\"No summaries found for plan\")\n\t\treturn\n\t}\n\n\tlatestSummary := summmaries[len(summmaries)-1]\n\n\tbytes := []byte(latestSummary.Summary)\n\n\tw.Write(bytes)\n\n\tlog.Println(\"Successfully processed request for GetPlanStatusHandler\")\n}\n","sourceCodeStart":126,"sourceCodeEnd":161,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/plans_convo.go#L126-L161","documentation":"GetPlanStatusHandler returns this 500 when db.GetPlanSummaries fails to fetch summaries for the plan's convo messages. The convo itself loaded fine; the failure is in the summaries lookup (planId + convo message IDs). The database error is appended to the response and logged.","triggerScenarios":"GET plan status with a non-empty convo where the summaries query errors — database connection failure, malformed/oversized ID list, or a summaries table/schema mismatch after a version upgrade.","commonSituations":"Postgres outage or pool exhaustion; schema migration not applied so plan_summaries table/columns are missing; very long conversations producing large IN-clause queries that time out.","solutions":["Check the server log for the underlying GetPlanSummaries error","Verify database connectivity and that recent migrations (plan_summaries schema) were applied","Check whether the convo is extremely large, making the ID query slow/oversized; add batching if so","Retry the request to rule out a transient DB error"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const convo = await listPlanConvo(planId, branch);\nif (!convo.length) return null; // no messages means no summaries; skip status call","typeGuard":null,"tryCatchPattern":"try {\n  const status = await getPlanStatus(planId, branch);\n} catch (e) {\n  if (/Error getting plan summaries/.test(e.message)) {\n    return withBackoff(() => getPlanStatus(planId, branch), 3);\n  }\n  throw e;\n}","preventionTips":["Ensure DB migrations for plan_summaries are applied on every deploy","Cap or batch convo size before status queries","Retry transient DB 500s with backoff","Alert on 'Error getting plan summaries' log occurrences"],"tags":["http-500","database","plans","summaries"],"backgroundTag":"database-read-failed","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}