plandex-ai/plandex · error

Error validating email verification:

Error message

Error validating email verification: 

What it means

Before creating the account, the handler calls db.ValidateEmailVerification(email, pin). If verification fails (unknown email, wrong/expired PIN, missing verification record), it responds 500 with `Error validating email verification: <detail>`. This is skipped in development local mode.

Source

Thrown at app/server/handlers/accounts.go:56

	var req shared.CreateAccountRequest
	err = json.Unmarshal(body, &req)
	if err != nil {
		log.Printf("Error unmarshalling request: %v\n", err)
		http.Error(w, "Error unmarshalling request: "+err.Error(), http.StatusInternalServerError)
		return
	}
	req.Email = strings.ToLower(req.Email)

	var emailVerificationId string

	// skipping email verification in dev/local mode
	if !isLocalMode {
		emailVerificationId, err = db.ValidateEmailVerification(req.Email, req.Pin)

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

	var apiErr *shared.ApiError
	var user *db.User
	var userId string
	var token string
	var orgId string

	err = db.WithTx(r.Context(), "create account", func(tx *sqlx.Tx) error {
		res, err := db.CreateAccount(req.UserName, req.Email, emailVerificationId, tx)

		if err != nil {
			return fmt.Errorf("error creating account: %v", err)
		}

		user = res.User

View on GitHub (pinned to e2d772072e)

Solutions

  1. Re-request the verification email/PIN and submit the newest code
  2. Double-check the email address matches the one verification was issued for
  3. Verify the email_verification table has a row for this email and that it is unexpired
  4. For local dev, set GOENV=development and LOCAL_MODE=1 to bypass verification

Example fix

// before
{ "email": "user@example.com", "pin": "123456" }  // old/expired pin
// after
requestNewVerificationPin("user@example.com")
// then submit the fresh pin
Defensive patterns

Strategy: validation

Validate before calling

if email == "" || pin == "" {
    return errors.New("email and verification pin are required")
}
// ensure a verification was requested recently for this email

Prevention

When it happens

Trigger: POSTing a create-account request with a PIN that does not match the code emailed to the user, an email that never started verification, or a verification record that expired.

Common situations: Users mistyping the 4-6 digit PIN; waiting past the verification expiry window; requesting a new code and submitting the old one; running against a database missing the email_verification row.

Related errors


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