hashicorp/terraform · error
input is disabled
Error message
input is disabled
What it means
Returned by Meta.confirm() (meta.go:658). confirm() is the shared yes/no helper; it first checks m.Input() (the -input flag) and if input is disabled it returns errors.New("input is disabled") before even prompting. This surfaces when a command path needs confirmation but was invoked non-interactively.
Source
Thrown at internal/command/meta.go:660
if m.View != nil {
m.View.Configure(&arguments.View{
CompactWarnings: m.compactWarnings,
NoColor: !m.Color,
})
}
return args
}
// uiHook returns the UiHook to use with the context.
func (m *Meta) uiHook() *views.UiHook {
return views.NewUiHook(m.View)
}
// confirm asks a yes/no confirmation.
func (m *Meta) confirm(opts *terraform.InputOpts) (bool, error) {
if !m.Input() {
return false, errors.New("input is disabled")
}
for i := 0; i < 2; i++ {
v, err := m.UIInput().Input(context.Background(), opts)
if err != nil {
return false, fmt.Errorf(
"Error asking for confirmation: %s", err)
}
switch strings.ToLower(v) {
case "no":
return false, nil
case "yes":
return true, nil
}
}
return false, nil
}View on GitHub (pinned to c9def3e214)
Solutions
- Re-run with input enabled (remove -input=false) if you can answer interactively.
- Provide the decision out-of-band: use -auto-approve, -force, or the relevant flag so the confirm path is skipped.
- If embedding Terraform, set the equivalent of -auto-approve or avoid calling confirm() in non-interactive contexts.
Example fix
# before terraform apply -input=false # confirm() path hit -> 'input is disabled' # after terraform apply -auto-approve # skips confirm entirely
Defensive patterns
Strategy: validation
Validate before calling
// Before relying on confirm(), check the input flag / TTY.
if !meta.Input() || !isatty.IsTerminal(os.Stdin.Fd()) {
// cannot confirm; pass the appropriate -auto-approve/-force flag instead
} Try / catch
ok, err := meta.confirm(opts)
if err != nil && strings.Contains(err.Error(), "input is disabled") {
// re-run with -auto-approve or equivalent
} Prevention
- When running non-interactively, always pass the command's auto-approve/force flag to bypass confirm().
- Do not call confirm() in code paths that may run with -input=false.
When it happens
Trigger: Any command that calls m.confirm() — e.g. confirmation prompts — while running with -input=false, in a non-TTY, or when m.input was set false by automation flags. The caller receives the error instead of a yes/no result.
Common situations: Running terraform in CI with -input=false where a code path still invokes confirm(); custom commands/embedding that disable input but trigger a confirmation step.
Related errors
- Can't ask approval for state migration when interactive inpu
- Error asking %s: %v
- interrupted
- Failed to override: %w %s
- Error asking %s: %v
AI-assisted analysis of hashicorp/terraform@c9def3e214 (2026-08-07).
Data as JSON: /api/errors/9569b942f2087811.
Report an issue: GitHub.