{"record":{"id":"143c5a34d00fb72c","repo":"plandex-ai/plandex","slug":"error-prompting-pin-v","errorCode":null,"errorMessage":"error prompting pin: %v","messagePattern":"error prompting pin: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/account.go","lineNumber":229,"sourceCode":"\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\n\treturn &verifyEmailRes{\n\t\thasAccount:  res.HasAccount,\n\t\tisLocalMode: false,\n\t\tpin:         pin,\n\t}, nil\n}\n\nfunc signIn(email, pin, host string) error {\n\tterm.StartSpinner(\"\")\n\tres, apiErr := apiClient.SignIn(shared.SignInRequest{\n\t\tEmail: email,\n\t\tPin:   pin,\n\t}, host)\n\tterm.StopSpinner()\n\n\tif apiErr != nil {","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/account.go#L211-L247","documentation":"After a successful CreateEmailVerification on a non-local host, verifyEmail prompts for the 6-character emailed pin via term.GetUserPasswordInput and wraps prompt failure as 'error prompting pin: %v'. It is a client-side input failure (non-interactive stdin, empty input, or abort) and notably does not occur in local mode, which skips the pin prompt entirely.","triggerScenarios":"term.GetUserPasswordInput(\"Please enter your pin:\") errors: stdin is not a TTY (CI/scripts), the user aborts the prompt, or input collection fails before the pin is sent to the server.","commonSituations":"Running the sign-in inside CI or a container without a TTY; piping input in ways the password prompt rejects; user hits Ctrl-C while waiting for the pin email to arrive.","solutions":["Run the command in an interactive terminal so the hidden password-style input works.","Wait for the pin email (valid 5 minutes) before starting the prompt, or re-run to get a fresh pin.","In Docker/CI, attach a TTY (docker run -it) or pre-authenticate interactively first.","Re-run the auth flow if the prompt was aborted; the pin is re-requested on the next attempt."],"exampleFix":"// before (no TTY)\necho pin | plandex auth\n// after\nplandex auth  # interactive prompt, enter pin when asked","handlingStrategy":"validation","validationCode":"// require an interactive terminal before the hidden pin prompt\nif stat, _ := os.Stdin.Stat(); stat == nil || (stat.Mode()&os.ModeCharDevice) == 0 {\n    return fmt.Errorf(\"pin prompt requires an interactive terminal\")\n}","typeGuard":null,"tryCatchPattern":"pin, err := term.GetUserPasswordInput(\"Please enter your pin:\")\nif err != nil {\n    return fmt.Errorf(\"pin entry aborted (%v); re-run auth in an interactive terminal and enter the pin within 5 minutes\", err)\n}","preventionTips":["Run sign-in in a real TTY; the pin input is a hidden password-style prompt.","Wait for the pin email before starting the prompt — it is valid for only 5 minutes.","In containers/CI, use -it or pre-authenticate interactively beforehand.","Note local mode skips the pin prompt entirely; prefer it when running locally."],"tags":["cli","interactive-prompt","pin","tty"],"backgroundTag":"no-tty-interactive-prompt-failed","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"}