hashicorp/packer · error
Error asking for input: %s
Error message
Error asking for input: %s
What it means
The breakpoint provisioner could not read the user's confirmation from the UI. ui.Ask failed — typically because stdin is not an interactive terminal, so the provisioner cannot pause for the Enter keypress.
Source
Thrown at provisioner/breakpoint/provisioner.go:77
ui.Say("Breakpoint provisioner disabled; continuing...")
}
return nil
}
if p.config.Note != "" {
ui.Say(fmt.Sprintf("Pausing at breakpoint provisioner with note \"%s\".", p.config.Note))
} else {
ui.Say("Pausing at breakpoint provisioner.")
}
message := "Press enter to continue."
var g errgroup.Group
result := make(chan string, 1)
g.Go(func() error {
line, err := ui.Ask(message)
if err != nil {
return fmt.Errorf("Error asking for input: %s", err)
}
result <- line
return nil
})
if err := g.Wait(); err != nil {
return err
}
return nil
}
View on GitHub (pinned to eb36e3c3e4)
Solutions
- Set disable = true on the breakpoint provisioner for non-interactive runs
- Run packer in a terminal with an attached TTY, or use env var interactivity (e.g. `script`/`expect` in CI)
- Remove the breakpoint provisioner from automated builds
- Set a note and use the breakpoint only in local debugging sessions
Example fix
// before
provisioner breakpoint {}
// after (CI-safe)
provisioner breakpoint {
disable = true
note = "inspection point (disabled in CI)"
} Defensive patterns
Strategy: validation
Validate before calling
// In CI, ensure the breakpoint is disabled before building: grep -q 'provisioner "breakpoint"' template.pkr.hcl && \ grep -q 'disable *= *true' template.pkr.hcl || \ echo 'breakpoint must set disable = true in CI'
Try / catch
if err := packerBuild(); err != nil {
if strings.Contains(err.Error(), "Error asking for input") {
// stdin is not a TTY: set disable=true or run interactively
}
} Prevention
- Never leave an enabled breakpoint provisioner in CI pipelines
- Attach a TTY (or remove the provisioner) when running packer non-interactively
- Use `disable = true` and keep the note for documentation
When it happens
Trigger: Provision() runs with an interactive breakpoint (disable not set) and ui.Ask returns an error because stdin is closed, a TTY is unavailable, or the ask was interrupted — common in CI or when running packer with piped/redirected stdin or -non-interactive.
Common situations: Running packer in CI pipelines (no TTY); automated runs with stdin redirected from /dev/null; the packer process detached from a terminal; users canceling the prompt with Ctrl-C.
Related errors
- source must be specified when auto_generate is not enabled
- Only one of script or scripts can be specified.
- Must supply an 'elevated_user' if 'elevated_password' provid
- Either a script file or inline script must be specified.
- Only a script file or an inline script can be specified, not
AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05).
Data as JSON: /api/errors/9367093d25dface3.
Report an issue: GitHub.