hashicorp/terraform · error
Failed to override
Error message
Failed to override: %w %s
What it means
Returned when the interactive override confirmation (b.confirm) fails with an error other than errRunOverridden. This is a failure of the confirmation/input mechanism itself - the user was prompted to type 'override' and the input flow errored rather than producing a clean accept/reject.
Solutions
- At the prompt, type exactly the word 'override' (case-sensitive per the prompt description).
- Ensure the session is interactive (TTY) and the UI input adapter is healthy.
- If overriding non-interactively is needed, use 'terraform apply -auto-approve' with a token whose team has override permission.
- Use the run URL to override directly in the TFC/TFE UI if the prompt keeps failing.
Example fix
# at the prompt Do you want to override the soft failed policy check? # type exactly: override
Defensive patterns
Strategy: validation
Validate before calling
// Validate the interactive context before offering override.
func canPromptOverride(op *backendrun.Operation) bool {
return op.UIIn != nil && op.UIOut != nil && op.Type != backendrun.OperationTypePlan
} Try / catch
// Wrap confirm and translate input errors into actionable guidance.
if err := b.confirm(ctx, op, opts, r, "override"); err != nil && !errors.Is(err, errRunOverridden) {
return fmt.Errorf("override prompt failed (%w); type 'override' exactly or override via the run URL", err)
} Prevention
- Document that the prompt expects the literal keyword 'override'.
- Provide a non-interactive override path (UI/API) for when the prompt is unreliable.
- Test prompts in the actual terminal/CI frontend before relying on them.
When it happens
Trigger: b.confirm(stopCtx, op, opts, r, "override") returns a non-nil error != errRunOverridden. Caused by the user typing something other than 'override' that the input handler treats as an error, a UI input adapter failure, or a context/timeout during the prompt.
Common situations: User mistyped at the override prompt; terminal closed or piped non-interactive input; input timeout; UIIn adapter returned an unexpected error in a custom frontend.
Related errors
AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11).
Data as JSON: /api/errors/fc8aadb60e3e1ffc.
Report an issue: GitHub.
Appendix: source
Thrown at internal/backend/remote/backend_common.go:466
if op.Type == backendrun.OperationTypePlan || op.UIOut == nil || op.UIIn == nil ||
!pc.Actions.IsOverridable || !pc.Permissions.CanOverride {
return fmt.Errorf("%s soft failed.\n%s", msgPrefix, runURL)
}
if op.AutoApprove {
if _, err = b.client.PolicyChecks.Override(stopCtx, pc.ID); err != nil {
return generalError(fmt.Sprintf("Failed to override policy check.\n%s", runURL), err)
}
} else {
opts := &terraform.InputOpts{
Id: "override",
Query: "\nDo you want to override the soft failed policy check?",
Description: "Only 'override' will be accepted to override.",
}
err = b.confirm(stopCtx, op, opts, r, "override")
if err != nil && err != errRunOverridden {
return fmt.Errorf("Failed to override: %w\n%s\n", err, runURL)
}
if err != errRunOverridden {
if _, err = b.client.PolicyChecks.Override(stopCtx, pc.ID); err != nil {
return generalError(fmt.Sprintf("Failed to override policy check.\n%s", runURL), err)
}
} else {
runURL := fmt.Sprintf(runHeader, b.hostname, b.organization, op.Workspace, r.ID)
b.CLI.Output(fmt.Sprintf("The run needs to be manually overridden or discarded.\n%s\n", runURL))
}
}
if b.CLI != nil {
b.CLI.Output("------------------------------------------------------------------------")
}
default:
return fmt.Errorf("Unknown or unexpected policy state: %s", pc.Status)
}View on GitHub (pinned to d32a084675)