{"record":{"id":"47c4f60514002ca5","repo":"pulumi/pulumi","slug":"no-log-file-selected-47c4f6","errorCode":null,"errorMessage":"no log file selected","messagePattern":"no log file selected","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/cmd/pulumi/logs/remove.go","lineNumber":200,"sourceCode":"\nfunc chooseLogToRemove(logsDir string) (logEntry, error) {\n\tentries, err := listLogs(logsDir)\n\tif err != nil {\n\t\treturn logEntry{}, err\n\t}\n\tif len(entries) == 0 {\n\t\treturn logEntry{}, fmt.Errorf(\"no log files found in %s\", logsDir)\n\t}\n\n\toptions, optionMap := formatLogRemovalChoices(entries)\n\n\tvar choice string\n\tif err := survey.AskOne(&survey.Select{\n\t\tMessage:  \"Select a log file to remove:\",\n\t\tOptions:  options,\n\t\tPageSize: cmd.OptimalPageSize(cmd.OptimalPageSizeOpts{Nopts: len(options)}),\n\t}, &choice, ui.SurveyIcons(cmdutil.GetGlobalColorization())); err != nil {\n\t\treturn logEntry{}, errors.New(\"no log file selected\")\n\t}\n\n\tselected := optionMap[choice]\n\tfor _, e := range entries {\n\t\tif e.path == selected {\n\t\t\treturn e, nil\n\t\t}\n\t}\n\treturn logEntry{}, errors.New(\"internal error: selected log not found\")\n}\n\nfunc printRemovalTable(out io.Writer, entries []logEntry) {\n\trows := slice.Prealloc[cmdutil.TableRow](len(entries))\n\tfor _, e := range entries {\n\t\tstack := e.stackDisplay()\n\t\tupdateID := e.updateID\n\t\tif updateID == \"\" {\n\t\t\tupdateID = \"—\"","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/logs/remove.go#L182-L218","documentation":"In the interactive picker (pkg/cmd/pulumi/logs/remove.go:200), survey.AskOne renders a select list of log files. If AskOne returns an error — the user presses Ctrl+C/Esc, or the prompt fails — the code deliberately discards the survey error and returns the generic message 'no log file selected', signaling that no choice was made.","triggerScenarios":"Pressing Ctrl+C or Esc at the 'Select a log file to remove:' prompt; the survey library failing to read from stdin/stdout (redirected or too-small terminal) while the CLI still considers the session interactive.","commonSituations":"User changes their mind mid-prompt and aborts; piping input into an interactive command so survey cannot present a proper TTY select prompt; terminal multiplexers intercepting the key.","solutions":["Re-run `pulumi logs remove` and complete the selection","Use non-interactive flags instead: --all, --stack <name>, or --before <value>","Run in a real TTY if stdin/stdout were redirected","Press Ctrl+C deliberately to cancel — this error is the expected cancellation path"],"exampleFix":"# before\npulumi logs remove < /dev/null   # survey fails -> 'no log file selected'\n# after\npulumi logs remove --stack dev --yes","handlingStrategy":"fallback","validationCode":"# ensure a TTY is available before interactive commands\n[ -t 0 ] && [ -t 1 ] || pulumi logs remove --all --yes","typeGuard":null,"tryCatchPattern":"# shell\npulumi logs remove || pulumi logs remove --all --yes   # fall back on cancel/failure\n# Go (auto SDK wrapper)\nif err := run(); err != nil && strings.Contains(err.Error(), \"no log file selected\") {\n    return runWithFlags()\n}","preventionTips":["Complete or intentionally cancel the prompt — Ctrl+C maps to this error","For automation, always use flag-based selection instead of the picker","Run interactive commands in a real terminal, not with redirected stdin"],"tags":["cli","interactive","survey-prompt","canceled","pulumi"],"backgroundTag":"prompt-cancelled","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}