{"record":{"id":"474897fde7e2abdf","repo":"plandex-ai/plandex","slug":"error-prompting-email-v","errorCode":null,"errorMessage":"error prompting email: %v","messagePattern":"error prompting email: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/account.go","lineNumber":173,"sourceCode":"\n\tif selected == SignInLocalOption {\n\t\thost, err = term.GetRequiredUserStringInputWithDefault(\"Host:\", \"http://localhost:8099\")\n\t} else {\n\t\thost, err = term.GetRequiredUserStringInput(\"Host:\")\n\t}\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error prompting host: %v\", err)\n\t}\n\n\tif selected == SignInLocalOption {\n\t\temail = \"local-admin@plandex.ai\"\n\t} else {\n\t\temail, err = term.GetRequiredUserStringInput(\"Your email:\")\n\t}\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error prompting email: %v\", err)\n\t}\n\n\tres, err := verifyEmail(email, host)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error verifying email: %v\", err)\n\t}\n\n\tif res.hasAccount {\n\t\terr := signIn(email, res.pin, host)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error signing in: %v\", err)\n\t\t}\n\t} else {\n\t\terr := createAccount(email, res.pin, host, res.isLocalMode)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating account: %v\", err)\n\t\t}","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/account.go#L155-L191","documentation":"promptSignInNewAccount wraps a failure from term.GetRequiredUserStringInput for the email prompt as 'error prompting email: %v'. It occurs only on the 'Another host' path (local mode hardcodes local-admin@plandex.ai). This is a client-side input failure, not an API error.","triggerScenarios":"term.GetRequiredUserStringInput(\"Your email:\") returns an error: empty input on a required prompt, stdin not interactive, or the user cancels the prompt.","commonSituations":"Non-interactive shells/CI without a TTY; user presses Enter without typing an email; prompt aborted with Ctrl-C.","solutions":["Type a valid email address at the 'Your email:' prompt instead of submitting empty input.","Run the command in an interactive terminal.","If you intended local mode, select 'Local mode host' — the email is then set automatically.","Abort and re-run to restart the sign-in flow cleanly if the prompt state is stuck."],"exampleFix":"// before\nYour email: (empty)\n// after\nYour email: user@example.com","handlingStrategy":"validation","validationCode":"// validate email format before the flow so the required-input prompt is answered correctly\nemail := \"user@example.com\"\nif !strings.Contains(email, \"@\") || strings.TrimSpace(email) == \"\" {\n    return fmt.Errorf(\"invalid email %q\", email)\n}","typeGuard":null,"tryCatchPattern":"email, err := term.GetRequiredUserStringInput(\"Your email:\")\nif err != nil {\n    return fmt.Errorf(\"email prompt failed (%v); choose 'Local mode host' to skip the email prompt\", err)\n}","preventionTips":["Have the email ready before starting sign-in.","Choose 'Local mode host' when applicable — the email is set to local-admin@plandex.ai automatically.","Run interactively; empty input on a required prompt is always an error.","Re-run the flow if you abort the prompt rather than retrying mid-prompt."],"tags":["cli","interactive-prompt","input-validation"],"backgroundTag":"empty-required-input","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"}