plandex-ai/plandex · error
error creating account: %v
Error message
error creating account: %v
What it means
When verifyEmail reports no existing account (res.hasAccount == false), promptSignInNewAccount calls createAccount(email, res.pin, host, res.isLocalMode); failure is wrapped as 'error creating account: %v'. It means the server refused the account-creation request for the supplied email/pin.
Source
Thrown at app/cli/auth/account.go:190
if err != nil {
return fmt.Errorf("error prompting email: %v", err)
}
res, err := verifyEmail(email, host)
if err != nil {
return fmt.Errorf("error verifying email: %v", err)
}
if res.hasAccount {
err := signIn(email, res.pin, host)
if err != nil {
return fmt.Errorf("error signing in: %v", err)
}
} else {
err := createAccount(email, res.pin, host, res.isLocalMode)
if err != nil {
return fmt.Errorf("error creating account: %v", err)
}
}
if !term.IsRepl {
term.PrintCmds("", "")
}
return nil
}
type verifyEmailRes struct {
hasAccount bool
isLocalMode bool
pin string
}
func verifyEmail(email, host string) (*verifyEmailRes, error) {
term.StartSpinner("")View on GitHub (pinned to e2d772072e)
Solutions
- If the email may already exist, re-run the flow — verifyEmail will then route to sign-in instead of createAccount.
- Restart the sign-in flow to get a fresh pin and complete creation within its validity window.
- Check the nested server message for the specific rejection (duplicate email, invalid pin, validation) and address it.
- Verify the host/server is the intended one (local vs cloud) to avoid state mismatch.
Example fix
// before: account already exists, creation rejected plandex auth -> createAccount(user@example.com) -> duplicate email error // after: existing accounts sign in via the verification path instead plandex auth # verifyEmail reports hasAccount -> signIn path
Defensive patterns
Strategy: retry
Try / catch
if err := createAccount(email, pin, host, isLocalMode); err != nil {
// account may already exist: re-run verifyEmail so hasAccount routes to signIn instead
return fmt.Errorf("account creation failed (%v); re-run auth — existing accounts are routed to sign-in", err)
} Prevention
- If unsure whether the account exists, just re-run the auth flow — verifyEmail picks the right path.
- Complete creation promptly; the pin from verification expires in 5 minutes.
- Check the server message for duplicate-email rejections before assuming a bug.
- Keep host/deployment consistent (local vs cloud) to avoid split account state.
When it happens
Trigger: createAccount's API call fails: invalid or expired verification pin, the email was actually registered between verification and creation, server-side validation rejects the email, or host/network errors.
Common situations: Expired pin while the user hesitates at account creation; user previously signed up with the same email so the server now rejects creation; self-hosted server with restrictions on new accounts; stale server state after a local DB reset.
Related errors
- error signing in: %v
- error selecting account: account not found
- error listing orgs: %v
- error selecting or signing in to account: %v
- error verifying email: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/1f0c441a42ad5419.
Report an issue: GitHub.