{"record":{"id":"3963c5ed9cdd4489","repo":"plandex-ai/plandex","slug":"error-getting-plan-settings-v-3963c5","errorCode":null,"errorMessage":"error getting plan settings: %v","messagePattern":"error getting plan settings: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/model/plan/tell_load.go","lineNumber":81,"sourceCode":"\t\tCancelFn: active.CancelFn,\n\t\tReason:   \"load tell plan\",\n\t}, func(repo *db.GitRepo) error {\n\t\terrCh := make(chan error, 4)\n\n\t\t// get name for plan and rename if it's a draft\n\t\tgo func() {\n\t\t\tdefer func() {\n\t\t\t\tif r := recover(); r != nil {\n\t\t\t\t\tlog.Printf(\"panic in getPlanSettings: %v\\n%s\", r, debug.Stack())\n\t\t\t\t\terrCh <- fmt.Errorf(\"panic getting plan settings: %v\\n%s\", r, debug.Stack())\n\t\t\t\t\truntime.Goexit() // don't allow outer function to continue and double-send to channel\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\tres, err := db.GetPlanSettings(plan)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error getting plan settings: %v\\n\", err)\n\t\t\t\terrCh <- fmt.Errorf(\"error getting plan settings: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsettings = res\n\n\t\t\torgUserConfigRes, err := db.GetOrgUserConfig(auth.User.Id, auth.OrgId)\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error getting org user config: %v\\n\", err)\n\t\t\t\terrCh <- fmt.Errorf(\"error getting org user config: %v\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\torgUserConfig = orgUserConfigRes\n\n\t\t\tif plan.Name == \"draft\" {\n\t\t\t\tname, err := model.GenPlanName(\n\t\t\t\t\tauth,\n\t\t\t\t\tplan,\n\t\t\t\t\tsettings,\n\t\t\t\t\torgUserConfig,","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/tell_load.go#L63-L99","documentation":"db.GetPlanSettings returned a non-nil error while loading settings for the plan in the tell flow's loader goroutine. The error is wrapped as 'error getting plan settings: %v' and sent on errCh, aborting the tell request before any LLM call.","triggerScenarios":"GetPlanSettings fails: DB connection failure, missing settings row for the plan ID, SQL syntax/permission error, or context cancellation while the query runs.","commonSituations":"Postgres down or connection pool exhausted; plan settings row deleted manually; schema migration mismatch after upgrade; plan canceled (context canceled) mid-load.","solutions":["Check the wrapped DB error for connection vs missing-row causes","Verify DB connectivity and that the plan row/settings exist","Run pending schema migrations","Retry the tell request if it was a transient DB/context failure"],"exampleFix":"// before\n// settings row manually deleted\nDELETE FROM plan_settings WHERE plan_id = 'abc';\n// after: reset via app or recreate defaults\nINSERT INTO plan_settings (plan_id, data) VALUES ('abc', '{}');","handlingStrategy":"retry","validationCode":"if err := db.PingContext(ctx); err != nil {\n    return fmt.Errorf(\"database unavailable: %w\", err)\n}\nif !planSettingsExists(ctx, plan.Id) {\n    return fmt.Errorf(\"no settings row for plan %s; initialize before Tell\", plan.Id)\n}","typeGuard":null,"tryCatchPattern":"select {\ncase err := <-errCh:\n    if strings.HasPrefix(err.Error(), \"error getting plan settings:\") {\n        // retry transient DB errors with backoff; surface persistent ones\n    }\ncase res := <-resCh:\n    settings = res\n}","preventionTips":["Monitor DB health and connection-pool saturation","Run migrations before deploying new versions","Avoid deleting plan_settings rows manually; use the app's reset","Distinguish context-canceled errors (user aborts) from real DB failures"],"tags":["database","plan-settings","persistence"],"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"}