{"record":{"id":"1e581508559441dd","repo":"plandex-ai/plandex","slug":"error-getting-org-user-config","errorCode":null,"errorMessage":"Error getting org user config: ","messagePattern":"Error getting org user config: ","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"app/server/handlers/context_helper.go","lineNumber":109,"sourceCode":"\tvar clients map[string]model.ClientInfo\n\tvar authVars map[string]string\n\tvar orgUserConfig *shared.OrgUserConfig\n\n\tfor _, context := range *loadReq {\n\t\tif context.ContextType == shared.ContextPipedDataType || context.ContextType == shared.ContextNoteType || context.ContextType == shared.ContextImageType {\n\n\t\t\tsettings, err = db.GetPlanSettings(plan)\n\n\t\t\tif err != nil {\n\t\t\t\tlog.Printf(\"Error getting plan settings: %v\\n\", err)\n\t\t\t\thttp.Error(w, \"Error getting plan settings: \"+err.Error(), http.StatusInternalServerError)\n\t\t\t\treturn nil, nil\n\t\t\t}\n\n\t\t\torgUserConfig, 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\thttp.Error(w, \"Error getting org user config: \"+err.Error(), http.StatusInternalServerError)\n\t\t\t\treturn nil, nil\n\t\t\t}\n\n\t\t\tres := initClients(\n\t\t\t\tinitClientsParams{\n\t\t\t\t\tw:           w,\n\t\t\t\t\tauth:        auth,\n\t\t\t\t\tapiKeys:     context.ApiKeys,\n\t\t\t\t\topenAIOrgId: context.OpenAIOrgId,\n\t\t\t\t\tauthVars:    context.AuthVars,\n\t\t\t\t\tplan:        plan,\n\t\t\t\t\tsettings:    settings,\n\t\t\t\t},\n\t\t\t)\n\n\t\t\tclients = res.clients\n\t\t\tauthVars = res.authVars\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/context_helper.go#L91-L127","documentation":"Alongside plan settings, loads containing piped data, notes, or images need the org member's per-user configuration via db.GetOrgUserConfig(userId, orgId). A failure there aborts the load with HTTP 500, echoing the storage error.","triggerScenarios":"loadContexts with a piped/note/image context where db.GetOrgUserConfig(auth.User.Id, auth.OrgId) errors — the org_users config record can't be read or the storage layer fails.","commonSituations":"User removed from org but token still valid; org config file missing/corrupt in the repo storage; self-hosted storage backend degraded; migrations leaving org user config uncreated.","solutions":["Check server logs for the underlying err from db.GetOrgUserConfig","Confirm the user still belongs to the org and their org membership is intact","Validate the org user config file in the plans storage and restore from backup if corrupt","Check storage backend health (disk, permissions, object store connectivity)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// pre-check: confirm user still belongs to org before loading\nif !isOrgMember(auth.User.Id, auth.OrgId) {\n    return fmt.Errorf(\"user %s is not an active member of org %s\", auth.User.Id, auth.OrgId)\n}","typeGuard":null,"tryCatchPattern":"resp, err := doLoad(req)\nif err != nil && strings.Contains(err.Error(), \"Error getting org user config\") {\n    // verify org membership and storage health before retrying\n    return reconcileOrgUserConfig(err)\n}","preventionTips":["Revoke sessions when removing users from an org","Include org user config in storage backups","Watch for storage backend health in self-hosted deployments"],"tags":["http-500","database","org-config","storage","plandex"],"backgroundTag":"storage-read-failure","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}