{"record":{"id":"ab695f38e324181e","repo":"multica-ai/multica","slug":"no-input","errorCode":null,"errorMessage":"no input","messagePattern":"no input","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_auth.go","lineNumber":425,"sourceCode":"\t\tfmt.Fprintf(&b, \"\\nRemote SSH session detected. Before opening that URL on your local computer, forward the callback port in another terminal:\\n  ssh -L %d:127.0.0.1:%d <user>@<remote-host>\\nThen open the URL above in your local browser.\\n\", port, port)\n\t}\n\tfmt.Fprintln(&b, \"\\nWaiting for authentication...\")\n\treturn b.String()\n}\n\nfunc runAuthLoginToken(cmd *cobra.Command, providedToken string) error {\n\t// The prompt sentinel is what pflag substitutes for `--token` with no\n\t// value (see loginCmd init); treat it the same as an empty string so we\n\t// fall through to the interactive prompt.\n\tif providedToken == tokenPromptSentinel {\n\t\tprovidedToken = \"\"\n\t}\n\ttoken := strings.TrimSpace(providedToken)\n\tif token == \"\" {\n\t\tfmt.Print(\"Enter your personal access token: \")\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tif !scanner.Scan() {\n\t\t\treturn fmt.Errorf(\"no input\")\n\t\t}\n\t\ttoken = strings.TrimSpace(scanner.Text())\n\t}\n\tif token == \"\" {\n\t\treturn fmt.Errorf(\"token is required\")\n\t}\n\tif err := validateLoginTokenPrefix(token); err != nil {\n\t\treturn err\n\t}\n\n\tserverURL := resolveLoginTokenServerURL(cmd)\n\tclient := cli.NewAPIClient(serverURL, \"\", token)\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar me struct {\n\t\tName  string `json:\"name\"`","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_auth.go#L407-L443","documentation":"In token login, when --token was not supplied the CLI prompts on stdin with a bufio.Scanner. If scanner.Scan() returns false the input stream is closed (EOF) before any line was read — there is literally no input — so it aborts with 'no input' rather than an empty-token error.","triggerScenarios":"Running `multica login` interactively expecting the token prompt but stdin is closed/redirected from /dev/null; piping nothing (`multica login < /dev/null`); running the command under a non-interactive scheduler with no TTY.","commonSituations":"Automation invoking the login command without --token; CI jobs; users hitting Enter-less EOF (Ctrl-D) at the prompt; wrappers that detach stdin.","solutions":["Always pass the token explicitly in scripts: `multica login --token mul_...`","Pipe the token via stdin when prompts are hard: `echo \"$TOKEN\" | multica login`","Run the command in a real terminal when using the interactive prompt"],"exampleFix":"# before (non-interactive, stdin closed)\nmultica login < /dev/null\n\n# after\nmultica login --token \"$MULTICA_TOKEN\"","handlingStrategy":"validation","validationCode":"# never rely on the prompt in non-interactive contexts\n[ -t 0 ] || : \"${MULTICA_TOKEN:?stdin is not a TTY; pass --token}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --token in scripts and CI","If piped input is needed: `printf '%s\\n' \"$TOKEN\" | multica login`"],"tags":["cli","auth","stdin","automation","login"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}