{"record":{"id":"fc8aadb60e3e1ffc","repo":"hashicorp/terraform","slug":"failed-to-override-w-s","errorCode":null,"errorMessage":"Failed to override: %w\n%s\n","messagePattern":"Failed to override: %w\n(.+?)\n","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote/backend_common.go","lineNumber":466,"sourceCode":"\n\t\t\tif op.Type == backendrun.OperationTypePlan || op.UIOut == nil || op.UIIn == nil ||\n\t\t\t\t!pc.Actions.IsOverridable || !pc.Permissions.CanOverride {\n\t\t\t\treturn fmt.Errorf(\"%s soft failed.\\n%s\", msgPrefix, runURL)\n\t\t\t}\n\n\t\t\tif op.AutoApprove {\n\t\t\t\tif _, err = b.client.PolicyChecks.Override(stopCtx, pc.ID); err != nil {\n\t\t\t\t\treturn generalError(fmt.Sprintf(\"Failed to override policy check.\\n%s\", runURL), err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\topts := &terraform.InputOpts{\n\t\t\t\t\tId:          \"override\",\n\t\t\t\t\tQuery:       \"\\nDo you want to override the soft failed policy check?\",\n\t\t\t\t\tDescription: \"Only 'override' will be accepted to override.\",\n\t\t\t\t}\n\t\t\t\terr = b.confirm(stopCtx, op, opts, r, \"override\")\n\t\t\t\tif err != nil && err != errRunOverridden {\n\t\t\t\t\treturn fmt.Errorf(\"Failed to override: %w\\n%s\\n\", err, runURL)\n\t\t\t\t}\n\n\t\t\t\tif err != errRunOverridden {\n\t\t\t\t\tif _, err = b.client.PolicyChecks.Override(stopCtx, pc.ID); err != nil {\n\t\t\t\t\t\treturn generalError(fmt.Sprintf(\"Failed to override policy check.\\n%s\", runURL), err)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\trunURL := fmt.Sprintf(runHeader, b.hostname, b.organization, op.Workspace, r.ID)\n\t\t\t\t\tb.CLI.Output(fmt.Sprintf(\"The run needs to be manually overridden or discarded.\\n%s\\n\", runURL))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif b.CLI != nil {\n\t\t\t\tb.CLI.Output(\"------------------------------------------------------------------------\")\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"Unknown or unexpected policy state: %s\", pc.Status)\n\t\t}","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/backend/remote/backend_common.go#L448-L484","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# at the prompt\nDo you want to override the soft failed policy check?\n# type exactly:\noverride","handlingStrategy":"validation","validationCode":"// Validate the interactive context before offering override.\nfunc canPromptOverride(op *backendrun.Operation) bool {\n    return op.UIIn != nil && op.UIOut != nil && op.Type != backendrun.OperationTypePlan\n}","typeGuard":null,"tryCatchPattern":"// Wrap confirm and translate input errors into actionable guidance.\nif err := b.confirm(ctx, op, opts, r, \"override\"); err != nil && !errors.Is(err, errRunOverridden) {\n    return fmt.Errorf(\"override prompt failed (%w); type 'override' exactly or override via the run URL\", err)\n}","preventionTips":["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."],"tags":["backend","remote-backend","policy","override","interactive","input","go"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}