plandex-ai/plandex · error
no org selected
Error message
no org selected
What it means
After resolveOrgAuth succeeds in createAccount, a nil org with a nil error means no organization was selected; the code deliberately returns "no org selected". Unlike error 27 this is a control-flow failure: org resolution completed but produced no org.
Source
Thrown at app/cli/auth/account.go:350
IsTrial: false,
IsCloud: host == "",
Host: host,
IsLocalMode: isLocalMode,
},
})
if err != nil {
return fmt.Errorf("error setting auth: %v", err)
}
org, err := resolveOrgAuth(res.Orgs, isLocalMode)
if err != nil {
return fmt.Errorf("error resolving org: %v", err)
}
if org == nil {
return fmt.Errorf("no org selected")
}
Current.OrgId = org.Id
Current.OrgName = org.Name
Current.IntegratedModelsMode = org.IntegratedModelsMode
err = writeCurrentAuth()
if err != nil {
return fmt.Errorf("error writing auth: %v", err)
}
fmt.Printf("✅ Signed in as %s | Org: %s\n", color.New(color.Bold, term.ColorHiGreen).Sprintf("<%s> %s", Current.UserName, Current.Email), color.New(term.ColorHiCyan).Sprint(Current.OrgName))
fmt.Println()
return nil
}
View on GitHub (pinned to e2d772072e)
Solutions
- Ensure the account belongs to at least one org (create one in the web console or via server seed).
- Retry account creation so the server provisions a default org.
- For self-hosted servers, configure a default org on startup.
- Then re-run sign-in to attach the org to the session.
Example fix
// before
orgs = [] # server returned no orgs -> "no org selected"
// after
# server: seed a default org for new accounts
POST /admin/orgs {"name": "Default"}
myapp auth login Defensive patterns
Strategy: type-guard
Validate before calling
// After account creation, guard before using the resolved org:
if org == nil {
return fmt.Errorf("no org selected: provision an org before finishing signup")
} Type guard
func orgSelected(org *shared.Org) bool {
return org != nil && org.Id != ""
}
// usage: if !orgSelected(org) { provisionOrg(); return retrySignIn() } Try / catch
if err := createAccount(email, pin, host, false); err != nil {
if strings.Contains(err.Error(), "no org selected") {
fmt.Fprintln(os.Stderr, "Account created but no org is attached; create an org in the console, then sign in:", err)
}
return err
} Prevention
- Ensure server-side default org provisioning for new accounts.
- Treat nil-org-with-nil-error as a distinct case from resolution errors.
- Add a post-signup org check via the console/API.
- Document that self-hosted instances must create an initial org.
When it happens
Trigger: resolveOrgAuth returns (nil, nil) — the org list resolved to no selection (empty orgs list, or the user/prompt path yielding no org without erroring).
Common situations: Brand-new cloud account with zero organizations, server returning an empty Orgs array, or local-mode edge cases where no org is auto-created.
Related errors
- error selecting account: account not found
- error signing in: %v
- error selecting or signing in to account: %v
- error verifying email: %v
- error creating account: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/7ff7bea7f3b26908.
Report an issue: GitHub.