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

  1. If the email may already exist, re-run the flow — verifyEmail will then route to sign-in instead of createAccount.
  2. Restart the sign-in flow to get a fresh pin and complete creation within its validity window.
  3. Check the nested server message for the specific rejection (duplicate email, invalid pin, validation) and address it.
  4. 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

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


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