{"record":{"id":"9367093d25dface3","repo":"hashicorp/packer","slug":"error-asking-for-input-s","errorCode":null,"errorMessage":"Error asking for input: %s","messagePattern":"Error asking for input: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"provisioner/breakpoint/provisioner.go","lineNumber":77,"sourceCode":"\t\t\tui.Say(\"Breakpoint provisioner disabled; continuing...\")\n\t\t}\n\n\t\treturn nil\n\t}\n\tif p.config.Note != \"\" {\n\t\tui.Say(fmt.Sprintf(\"Pausing at breakpoint provisioner with note \\\"%s\\\".\", p.config.Note))\n\t} else {\n\t\tui.Say(\"Pausing at breakpoint provisioner.\")\n\t}\n\n\tmessage := \"Press enter to continue.\"\n\n\tvar g errgroup.Group\n\tresult := make(chan string, 1)\n\tg.Go(func() error {\n\t\tline, err := ui.Ask(message)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error asking for input: %s\", err)\n\t\t}\n\n\t\tresult <- line\n\t\treturn nil\n\t})\n\n\tif err := g.Wait(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n","sourceCodeStart":59,"sourceCodeEnd":89,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/provisioner/breakpoint/provisioner.go#L59-L89","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nprovisioner breakpoint {}\n// after (CI-safe)\nprovisioner breakpoint {\n  disable = true\n  note    = \"inspection point (disabled in CI)\"\n}","handlingStrategy":"validation","validationCode":"// In CI, ensure the breakpoint is disabled before building:\ngrep -q 'provisioner \"breakpoint\"' template.pkr.hcl && \\\n  grep -q 'disable *= *true' template.pkr.hcl || \\\n  echo 'breakpoint must set disable = true in CI'","typeGuard":null,"tryCatchPattern":"if err := packerBuild(); err != nil {\n    if strings.Contains(err.Error(), \"Error asking for input\") {\n        // stdin is not a TTY: set disable=true or run interactively\n    }\n}","preventionTips":["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"],"tags":["packer","breakpoint","stdin","interactive"],"backgroundTag":"no-tty-stdin-unavailable","analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}