{"record":{"id":"f655de1c510a648c","repo":"plandex-ai/plandex","slug":"error-updating-plan-updated-at-v","errorCode":null,"errorMessage":"error updating plan updated at: %v","messagePattern":"error updating plan updated at: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/server/db/plan_helpers.go","lineNumber":491,"sourceCode":"\n\t// owner has access\n\tif plan.OwnerId == userId {\n\t\treturn plan, nil\n\t}\n\n\t// plan is shared with org\n\tif plan.SharedWithOrgAt != nil {\n\t\treturn plan, nil\n\t}\n\n\treturn nil, nil\n}\n\nfunc BumpPlanUpdatedAt(planId string, t time.Time) error {\n\t_, err := Conn.Exec(\"UPDATE plans SET updated_at = $1 WHERE id = $2\", t, planId)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating plan updated at: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc GetPlanIdsForProject(projectId string) ([]string, error) {\n\tvar ids []string\n\terr := Conn.Select(&ids, \"SELECT id FROM plans WHERE project_id = $1\", projectId)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error getting plan ids for project: %v\", err)\n\t}\n\treturn ids, nil\n}\n","sourceCodeStart":473,"sourceCodeEnd":505,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/db/plan_helpers.go#L473-L505","documentation":"BumpPlanUpdatedAt runs an UPDATE on the plans table setting updated_at for a plan. Any Exec failure — connection error, constraint issue, plan row missing doesn't error here but a DB failure does — is wrapped with this message and returned to the caller (StorePlanSettings).","triggerScenarios":"Conn.Exec(\"UPDATE plans SET updated_at = $1 WHERE id = $2\") fails during StorePlanSettings — DB down, connection pool exhausted, transaction aborted, or invalid time value serialization.","commonSituations":"Connection pool exhaustion under load, database restarts mid-request, timezone/time serialization issues, or the DB session being killed by a statement timeout.","solutions":["Inspect the wrapped inner error for the exact driver failure","Verify DB connectivity and connection pool settings","Check for statement timeouts or aborted transactions around the call","Retry the bump; the operation is idempotent (it just sets a timestamp)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if planId == \"\" || t.IsZero() {\n    return errors.New(\"planId and non-zero timestamp required\")\n}","typeGuard":null,"tryCatchPattern":"err := BumpPlanUpdatedAt(planId, time.Now())\nif err != nil {\n    // idempotent: safe to retry\n    time.Sleep(100 * time.Millisecond)\n    err = BumpPlanUpdatedAt(planId, time.Now())\n}\nreturn err","preventionTips":["Tune connection pool size for your load","Set reasonable statement timeouts","Retry the bump — it is idempotent","Watch for aborted transactions in the surrounding request flow"],"tags":["go","database","update"],"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"}