pulumi/pulumi · info
no log file selected
Error message
no log file selected
What it means
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.
Source
Thrown at pkg/cmd/pulumi/logs/remove.go:200
func chooseLogToRemove(logsDir string) (logEntry, error) {
entries, err := listLogs(logsDir)
if err != nil {
return logEntry{}, err
}
if len(entries) == 0 {
return logEntry{}, fmt.Errorf("no log files found in %s", logsDir)
}
options, optionMap := formatLogRemovalChoices(entries)
var choice string
if err := survey.AskOne(&survey.Select{
Message: "Select a log file to remove:",
Options: options,
PageSize: cmd.OptimalPageSize(cmd.OptimalPageSizeOpts{Nopts: len(options)}),
}, &choice, ui.SurveyIcons(cmdutil.GetGlobalColorization())); err != nil {
return logEntry{}, errors.New("no log file selected")
}
selected := optionMap[choice]
for _, e := range entries {
if e.path == selected {
return e, nil
}
}
return logEntry{}, errors.New("internal error: selected log not found")
}
func printRemovalTable(out io.Writer, entries []logEntry) {
rows := slice.Prealloc[cmdutil.TableRow](len(entries))
for _, e := range entries {
stack := e.stackDisplay()
updateID := e.updateID
if updateID == "" {
updateID = "—"View on GitHub (pinned to 793f7b2e16)
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
Example fix
# before pulumi logs remove < /dev/null # survey fails -> 'no log file selected' # after pulumi logs remove --stack dev --yes
Defensive patterns
Strategy: fallback
Validate before calling
# ensure a TTY is available before interactive commands [ -t 0 ] && [ -t 1 ] || pulumi logs remove --all --yes
Try / catch
# shell
pulumi logs remove || pulumi logs remove --all --yes # fall back on cancel/failure
# Go (auto SDK wrapper)
if err := run(); err != nil && strings.Contains(err.Error(), "no log file selected") {
return runWithFlags()
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- no account selected; please use `pulumi login --interactive`
- invalid autonaming config: %w
- only one of --stack or argument stack name may be specified,
- failed to read overrides file: %w
- failed to parse overrides file: %w
AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31).
Data as JSON: /api/errors/47c4f60514002ca5.
Report an issue: GitHub.