hashicorp/terraform · error
input is disabled
Error message
input is disabled
What it means
Returned by `Meta.confirm` when it is asked to show a yes/no prompt but `m.Input()` is false (i.e. the process was started with `-input=false` or input was otherwise disabled). The function refuses to prompt and surfaces this error so callers can report that a required confirmation could not be obtained.
Solutions
- Pass `-auto-approve` (for apply) or supply the missing approval flag so the command does not need to prompt.
- Remove `-input=false` to allow the prompt if you are in an interactive terminal.
- Pre-resolve the decision the prompt was going to ask about (e.g. `terraform apply -auto-approve`, or `-force` for migrations).
Example fix
# before terraform apply -input=false # needs approval -> error # after terraform apply -input=false -auto-approve
Defensive patterns
Strategy: validation
Validate before calling
// Equivalent of what callers should check before relying on confirm():
if !m.Input() {
return errors.New("input is disabled; pass -auto-approve or remove -input=false")
} Prevention
- Pair `-input=false` with the corresponding auto-approval flag (-auto-approve, -force).
- Never call m.confirm() in code paths that may run non-interactively without a fallback.
- Test commands with `-input=false` in CI to catch missing approval flags early.
When it happens
Trigger: Any code path that calls `m.confirm(&terraform.InputOpts{...})` while `m.input == false` — typically because the user passed `-input=false` to a command that needs interactive confirmation.
Common situations: Running `terraform apply`/`plan`/`destroy`/state migration in CI with `-input=false` when the command would normally ask for approval; forgetting `-auto-approve` on apply.
Related errors
- errInteractiveInputDisabled
- Can't ask approval for state migration when interactive…
- Login cancelled
- backendDiags.Err()
- can't show a saved cloud plan unless the current root…
AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11).
Data as JSON: /api/errors/9569b942f2087811.
Report an issue: GitHub.
Appendix: 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 d32a084675)