{"record":{"id":"6797d9d45cf523eb","repo":"plandex-ai/plandex","slug":"error-getting-org-user-config-v-6797d9","errorCode":null,"errorMessage":"error getting org user config: %v","messagePattern":"error getting org user config: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/model/plan/tell_load.go","lineNumber":89,"sourceCode":"\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,\n\t\t\t\t\tclients,\n\t\t\t\t\tauthVars,\n\t\t\t\t\treq.Prompt,\n\t\t\t\t\tactive.SessionId,\n\t\t\t\t\tactive.Ctx,\n\t\t\t\t)\n\n\t\t\t\tif err != nil {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/model/plan/tell_load.go#L71-L107","documentation":"db.GetOrgUserConfig failed while fetching the org-scoped user configuration (model defaults, settings overrides) for the requesting user/org during tell plan loading. The wrapped error is sent on errCh and the tell flow aborts.","triggerScenarios":"GetOrgUserConfig(auth.User.Id, auth.OrgId) errors: user row missing for the org, DB outage, permission error, or context cancellation.","commonSituations":"User removed from org but session still active; fresh org without initialized user config; DB connectivity issues; auth token for a stale user ID.","solutions":["Verify the user still belongs to the org and the org user config exists (re-save org settings to initialize it)","Check DB connectivity and migration state","Re-authenticate so auth.User.Id matches a valid org member","Retry if the wrapped error indicates a transient failure"],"exampleFix":"// before\n// user removed from org, config row gone\n// after: re-add member so GetOrgUserConfig resolves\nINSERT INTO org_user_config (org_id, user_id, data) VALUES ('org1', 'user1', '{}');","handlingStrategy":"retry","validationCode":"if err := db.PingContext(ctx); err != nil {\n    return fmt.Errorf(\"database unavailable: %w\", err)\n}\nif !orgUserConfigExists(ctx, auth.User.Id, auth.OrgId) {\n    return fmt.Errorf(\"no org user config for user %s in org %s; initialize it first\", auth.User.Id, auth.OrgId)\n}","typeGuard":null,"tryCatchPattern":"select {\ncase err := <-errCh:\n    if strings.HasPrefix(err.Error(), \"error getting org user config:\") {\n        // re-init org user config or retry on transient DB error\n    }\ncase res := <-resCh:\n    orgUserConfig = res\n}","preventionTips":["Ensure every org member has an initialized org_user_config row","Re-authenticate users after org membership changes","Keep org config schema migrated with deployments","Retry transient DB errors before failing the tell request"],"tags":["database","org-config","auth"],"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"}