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

  1. Set disable = true on the breakpoint provisioner for non-interactive runs
  2. Run packer in a terminal with an attached TTY, or use env var interactivity (e.g. `script`/`expect` in CI)
  3. Remove the breakpoint provisioner from automated builds
  4. 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

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


AI-assisted analysis of hashicorp/packer@eb36e3c3e4 (2026-09-05). Data as JSON: /api/errors/9367093d25dface3. Report an issue: GitHub.