plandex-ai/plandex · error

Error getting org user config:

Error message

Error getting org user config: 

What it means

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.

Source

Thrown at app/server/handlers/context_helper.go:109

	var clients map[string]model.ClientInfo
	var authVars map[string]string
	var orgUserConfig *shared.OrgUserConfig

	for _, context := range *loadReq {
		if context.ContextType == shared.ContextPipedDataType || context.ContextType == shared.ContextNoteType || context.ContextType == shared.ContextImageType {

			settings, err = db.GetPlanSettings(plan)

			if err != nil {
				log.Printf("Error getting plan settings: %v\n", err)
				http.Error(w, "Error getting plan settings: "+err.Error(), http.StatusInternalServerError)
				return nil, nil
			}

			orgUserConfig, err = db.GetOrgUserConfig(auth.User.Id, auth.OrgId)
			if err != nil {
				log.Printf("Error getting org user config: %v\n", err)
				http.Error(w, "Error getting org user config: "+err.Error(), http.StatusInternalServerError)
				return nil, nil
			}

			res := initClients(
				initClientsParams{
					w:           w,
					auth:        auth,
					apiKeys:     context.ApiKeys,
					openAIOrgId: context.OpenAIOrgId,
					authVars:    context.AuthVars,
					plan:        plan,
					settings:    settings,
				},
			)

			clients = res.clients
			authVars = res.authVars

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check server logs for the underlying err from db.GetOrgUserConfig
  2. Confirm the user still belongs to the org and their org membership is intact
  3. Validate the org user config file in the plans storage and restore from backup if corrupt
  4. Check storage backend health (disk, permissions, object store connectivity)
Defensive patterns

Strategy: fallback

Validate before calling

// pre-check: confirm user still belongs to org before loading
if !isOrgMember(auth.User.Id, auth.OrgId) {
    return fmt.Errorf("user %s is not an active member of org %s", auth.User.Id, auth.OrgId)
}

Try / catch

resp, err := doLoad(req)
if err != nil && strings.Contains(err.Error(), "Error getting org user config") {
    // verify org membership and storage health before retrying
    return reconcileOrgUserConfig(err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/1e581508559441dd. Report an issue: GitHub.