plandex-ai/plandex · error
Error getting org user config
Error message
Error getting org user config
What it means
TellPlanHandler loads the user's per-org configuration via db.GetOrgUserConfig(auth.User.Id, auth.OrgId) to build model clients. A failure here means the database lookup for the org-user config row errored; the handler responds 500 'Error getting org user config'. This is a server-side persistence problem, not something the request body influences.
Source
Thrown at app/server/handlers/plans_exec.go:82
go notify.NotifyErr(notify.SeverityError, fmt.Errorf("error parsing request body: %v", err))
http.Error(w, "Error parsing request body", http.StatusBadRequest)
return
}
_, apiErr := hooks.ExecHook(hooks.WillTellPlan, hooks.HookParams{
Auth: auth,
Plan: plan,
})
if apiErr != nil {
go notify.NotifyErr(notify.SeverityError, fmt.Errorf("error executing will tell plan hook: %v", apiErr))
writeApiError(w, *apiErr)
return
}
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", http.StatusInternalServerError)
return
}
res := initClients(
initClientsParams{
w: w,
auth: auth,
apiKeys: requestBody.ApiKeys,
openAIOrgId: requestBody.OpenAIOrgId,
authVars: requestBody.AuthVars,
plan: plan,
settings: settings,
orgUserConfig: orgUserConfig,
},
)
err = modelPlan.Tell(modelPlan.TellParams{
Clients: res.clients,
Plan: plan,View on GitHub (pinned to e2d772072e)
Solutions
- Check database connectivity and health (db logs, `SELECT` on the org_user_configs table for the user/org ids).
- Re-authenticate so a fresh token bound to a still-valid org membership is used.
- Run pending database migrations for the server version and restart the server.
- If self-hosting, verify DB env vars (host, credentials, pool limits) and that the storage volume is writable.
Example fix
// after: fail fast with a clear startup check
cfg, err := db.GetOrgUserConfig(auth.User.Id, auth.OrgId)
if err != nil {
log.Printf("Error getting org user config for user %s org %s: %v", auth.User.Id, auth.OrgId, err)
http.Error(w, "Error getting org user config", http.StatusInternalServerError)
return
} Defensive patterns
Strategy: retry
Validate before calling
// pre-flight DB health check the operator can run // psql $DATABASE_URL -c "SELECT 1 FROM org_user_configs LIMIT 1;"
Try / catch
cfg, err := db.GetOrgUserConfig(userID, orgID)
if err != nil {
if isTransientDBError(err) { time.Sleep(backoff); cfg, err = db.GetOrgUserConfig(userID, orgID) }
if err != nil { return err }
} Prevention
- Keep DB migrations applied on every server upgrade.
- Monitor DB connectivity/pool saturation in production.
- Re-authenticate after org membership changes.
- Verify org_user_configs rows exist for active users when onboarding.
When it happens
Trigger: Authenticated tell-plan request where the org_user_configs table is unreadable, the row for (userId, orgId) query fails, the database connection is down, or the migration state is inconsistent with the running binary.
Common situations: Postgres/SQLite outage or connection-pool exhaustion; user removed from the org after the auth token was issued; schema migrations not applied after upgrading the server.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- error getting org user config: %v
- Error getting org user config:
- Error checking if plan exists:
- Error creating plan:
- Error renaming plan:
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/39fd6184f6409114.
Report an issue: GitHub.