{"record":{"id":"852f86d51e1e89e1","repo":"plandex-ai/plandex","slug":"error-prompting-host-v","errorCode":null,"errorMessage":"error prompting host: %v","messagePattern":"error prompting host: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/account.go","lineNumber":163,"sourceCode":"\nfunc promptSignInNewAccount() error {\n\tselected, err := term.SelectFromList(\"Use local mode or another host?\", []string{SignInLocalOption, SignInOtherOption})\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error selecting sign in option: %v\", err)\n\t}\n\n\tvar host string\n\tvar email string\n\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","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/account.go#L145-L181","documentation":"promptSignInNewAccount wraps a failure from term.GetRequiredUserStringInputWithDefault or term.GetRequiredUserStringInput when prompting for the server host as 'error prompting host: %v'. It is an input-collection failure: empty input rejection, non-interactive stdin, or user abort.","triggerScenarios":"The host prompt (default http://localhost:8099 for local mode, or required free-text for another host) fails: user submits empty input to a required prompt, stdin is unavailable/non-interactive, or the prompt is cancelled.","commonSituations":"Scripted/CI runs without a TTY; user presses Enter on empty input in the 'Another host' path; typo of only whitespace with required-input validation; aborted prompt.","solutions":["Enter a valid host URL (e.g. http://localhost:8099 for local mode) when prompted.","Run in an interactive terminal so the prompt can read stdin.","If using local mode, choose 'Local mode host' and accept the default instead of typing an empty custom host.","Verify the target Plandex server address before re-running to avoid repeated failed prompts."],"exampleFix":"// before\nHost: (empty input -> required-input error)\n// after\nHost: http://localhost:8099","handlingStrategy":"validation","validationCode":"// pre-validate the host you intend to enter\nhost := \"http://localhost:8099\"\nif u, err := url.Parse(host); err != nil || u.Scheme == \"\" || u.Host == \"\" {\n    return fmt.Errorf(\"invalid host %q: must include scheme and host\", host)\n}","typeGuard":null,"tryCatchPattern":"host, err := term.GetRequiredUserStringInput(\"Host:\")\nif err != nil {\n    return fmt.Errorf(\"host prompt failed (%v); enter a full URL like http://localhost:8099\", err)\n}","preventionTips":["Know your server URL before starting the flow; accept the local-mode default when applicable.","Never submit an empty value to a required prompt — abort and re-run with the URL at hand.","Verify the server is listening on that host/port before entering it.","Use the 'Local mode host' option to get the sensible default automatically."],"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-14T00:17:10.932Z"}