{"record":{"id":"6f32d86bcb00d2de","repo":"plandex-ai/plandex","slug":"error-creating-email-verification-v","errorCode":null,"errorMessage":"error creating email verification: %v","messagePattern":"error creating email verification: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/account.go","lineNumber":213,"sourceCode":"\t\tterm.PrintCmds(\"\", \"\")\n\t}\n\n\treturn nil\n}\n\ntype verifyEmailRes struct {\n\thasAccount  bool\n\tisLocalMode bool\n\tpin         string\n}\n\nfunc verifyEmail(email, host string) (*verifyEmailRes, error) {\n\tterm.StartSpinner(\"\")\n\tres, apiErr := apiClient.CreateEmailVerification(email, host, \"\")\n\tterm.StopSpinner()\n\n\tif apiErr != nil {\n\t\treturn nil, fmt.Errorf(\"error creating email verification: %v\", apiErr.Msg)\n\t}\n\n\tif res.IsLocalMode {\n\t\treturn &verifyEmailRes{\n\t\t\thasAccount:  res.HasAccount,\n\t\t\tisLocalMode: true,\n\t\t\tpin:         \"\",\n\t\t}, nil\n\t}\n\n\tfmt.Println(\"✉️  You'll now receive a 6 character pin by email. It will be valid for 5 minutes.\")\n\n\tpin, err := term.GetUserPasswordInput(\"Please enter your pin:\")\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error prompting pin: %v\", err)\n\t}\n","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/account.go#L195-L231","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the appended apiErr.Msg for the server's specific reason.","Confirm the server is running and reachable at the host (curl the health endpoint).","Correct the host URL and re-run the sign-in flow.","For self-hosted servers, check server logs and email/SMTP configuration, then retry."],"exampleFix":"// before\nHost: http://localhost:8090  (server actually on 8099)\n// after\nHost: http://localhost:8099","handlingStrategy":"retry","validationCode":"// reachability check before creating the verification\nif _, err := net.DialTimeout(\"tcp\", hostPort(host), 3*time.Second); err != nil {\n    return fmt.Errorf(\"cannot reach %s: %w\", host, err)\n}","typeGuard":null,"tryCatchPattern":"res, apiErr := apiClient.CreateEmailVerification(email, host, \"\")\nif apiErr != nil {\n    // inspect apiErr.Msg; if transient (network/5xx), back off and retry once\n    time.Sleep(2 * time.Second)\n    res, apiErr = apiClient.CreateEmailVerification(email, host, \"\")\n    if apiErr != nil { return apiErr }\n}","preventionTips":["Start the local server before authenticating (default http://localhost:8099).","Double-check the host URL scheme/port before submitting it.","For self-hosted servers, monitor logs and SMTP config since verification depends on email delivery.","Treat repeated failures as a server/deployment problem, not a client retry loop."],"tags":["network","email-verification","auth","api"],"backgroundTag":"connection-refused","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}