{"record":{"id":"e12fa85ba2072f17","repo":"plandex-ai/plandex","slug":"error-prompting-auto-add-domain-users-v","errorCode":null,"errorMessage":"error prompting auto add domain users: %v","messagePattern":"error prompting auto add domain users: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/org.go","lineNumber":72,"sourceCode":"\nfunc createOrg(isLocalMode bool) (*shared.Org, error) {\n\tvar err error\n\tvar name string\n\tvar autoAddDomainUsers bool\n\n\tif isLocalMode {\n\t\tname = \"Local Org\"\n\t} else {\n\t\tname, err = term.GetRequiredUserStringInput(\"Org name:\")\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error prompting org name: %v\", err)\n\t}\n\n\tif !isLocalMode {\n\t\tautoAddDomainUsers, err = promptAutoAddUsersIfValid(Current.Email)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error prompting auto add domain users: %v\", err)\n\t\t}\n\t}\n\n\tterm.StartSpinner(\"\")\n\tres, apiErr := apiClient.CreateOrg(shared.CreateOrgRequest{\n\t\tName:               name,\n\t\tAutoAddDomainUsers: autoAddDomainUsers,\n\t})\n\tterm.StopSpinner()\n\n\tif apiErr != nil {\n\t\treturn nil, fmt.Errorf(\"error creating org: %v\", apiErr.Msg)\n\t}\n\n\treturn &shared.Org{Id: res.Id, Name: name}, nil\n}\n\nfunc promptAutoAddUsersIfValid(email string) (bool, error) {","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/org.go#L54-L90","documentation":"This error wraps a failure from promptAutoAddUsersIfValid, which asks the user (via term.ConfirmYesNo) whether to enable domain auto-join for the org being created. It fires only in non-local mode when the yes/no confirmation prompt fails, aborting org creation.","triggerScenarios":"Calling createOrg in non-local mode where the account email's domain is not an email-service domain, and the subsequent term.ConfirmYesNo(\"Enable auto-join for <domain>?\") returns an error (stdin closed, EOF, I/O failure).","commonSituations":"Non-interactive environments (CI, piped stdin) where the auto-join confirmation cannot be answered; broken terminal input during onboarding of a new org with a corporate email domain.","solutions":["Run the command in an interactive terminal so the yes/no prompt can be answered","Pre-create the org or use local mode to skip the interactive auto-join prompt","Verify stdin is not redirected or closed","Retry if the terminal I/O error was transient"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure the auto-join prompt can be answered\nfi, _ := os.Stdin.Stat()\nif fi == nil || (fi.Mode()&os.ModeCharDevice) == 0 {\n    return fmt.Errorf(\"auto-join confirmation requires an interactive terminal\")\n}","typeGuard":null,"tryCatchPattern":"org, err := createOrg(false)\nif err != nil {\n    if strings.Contains(err.Error(), \"error prompting auto add domain users\") {\n        // re-run interactively or default autoAddDomainUsers to false\n    }\n    return err\n}","preventionTips":["Answer prompts in a real TTY; avoid echo/pipe tricks","Use local mode or pre-created orgs in scripted environments","Keep terminal input healthy (avoid suspending mid-prompt)"],"tags":["cli","interactive-input","stdin","prompt"],"backgroundTag":"non-interactive-terminal-prompt","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"}