plandex-ai/plandex · error

error creating email verification: %v

Error message

error creating email verification: %v

What it means

verifyEmail wraps a failure from apiClient.CreateEmailVerification(email, host, "") as 'error creating email verification: %v' with the server's apiErr.Msg appended. It means the CLI could not create a verification record on the target server — typically connectivity, host, or server-side rejection — before any pin is emailed.

Source

Thrown at app/cli/auth/account.go:213

		term.PrintCmds("", "")
	}

	return nil
}

type verifyEmailRes struct {
	hasAccount  bool
	isLocalMode bool
	pin         string
}

func verifyEmail(email, host string) (*verifyEmailRes, error) {
	term.StartSpinner("")
	res, apiErr := apiClient.CreateEmailVerification(email, host, "")
	term.StopSpinner()

	if apiErr != nil {
		return nil, fmt.Errorf("error creating email verification: %v", apiErr.Msg)
	}

	if res.IsLocalMode {
		return &verifyEmailRes{
			hasAccount:  res.HasAccount,
			isLocalMode: true,
			pin:         "",
		}, nil
	}

	fmt.Println("✉️  You'll now receive a 6 character pin by email. It will be valid for 5 minutes.")

	pin, err := term.GetUserPasswordInput("Please enter your pin:")

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

View on GitHub (pinned to e2d772072e)

Solutions

  1. Read the appended apiErr.Msg for the server's specific reason.
  2. Confirm the server is running and reachable at the host (curl the health endpoint).
  3. Correct the host URL and re-run the sign-in flow.
  4. For self-hosted servers, check server logs and email/SMTP configuration, then retry.

Example fix

// before
Host: http://localhost:8090  (server actually on 8099)
// after
Host: http://localhost:8099
Defensive patterns

Strategy: retry

Validate before calling

// reachability check before creating the verification
if _, err := net.DialTimeout("tcp", hostPort(host), 3*time.Second); err != nil {
    return fmt.Errorf("cannot reach %s: %w", host, err)
}

Try / catch

res, apiErr := apiClient.CreateEmailVerification(email, host, "")
if apiErr != nil {
    // inspect apiErr.Msg; if transient (network/5xx), back off and retry once
    time.Sleep(2 * time.Second)
    res, apiErr = apiClient.CreateEmailVerification(email, host, "")
    if apiErr != nil { return apiErr }
}

Prevention

When it happens

Trigger: apiClient.CreateEmailVerification returns a non-nil apiErr: host unreachable/wrong, server error while creating the verification, server rejects the email address, or the request is refused by the target deployment.

Common situations: Local Plandex server not started (localhost:8099 connection refused); typo in a custom host URL; self-hosted deployment misconfigured (email service down) so verification creation fails; pointing a cloud-issued flow at the wrong host.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


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