{"record":{"id":"c1392b36245d4012","repo":"hashicorp/terraform","slug":"overridden-using-the-ui-or-api-c1392b","errorCode":null,"errorMessage":"overridden using the UI or API","messagePattern":"overridden using the UI or API","errorType":"exception","errorClass":"errRunOverridden","httpStatus":null,"severity":"info","filePath":"internal/cloud/errors.go","lineNumber":21,"sourceCode":"\npackage cloud\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/hashicorp/terraform/internal/tfdiags\"\n\t\"github.com/zclconf/go-cty/cty\"\n)\n\n// String based errors\nvar (\n\terrApplyDiscarded                    = errors.New(\"Apply discarded.\")\n\terrDestroyDiscarded                  = errors.New(\"Destroy discarded.\")\n\terrRunApproved                       = errors.New(\"approved using the UI or API\")\n\terrRunDiscarded                      = errors.New(\"discarded using the UI or API\")\n\terrRunOverridden                     = errors.New(\"overridden using the UI or API\")\n\terrApplyNeedsUIConfirmation          = errors.New(\"Cannot confirm apply due to -input=false. Please handle run confirmation in the UI.\")\n\terrPolicyOverrideNeedsUIConfirmation = errors.New(\"Cannot override soft failed policy checks when -input=false. Please open the run in the UI to override.\")\n)\n\n// Diagnostic error messages\nvar (\n\tinvalidWorkspaceConfigMissingValues = tfdiags.AttributeValue(\n\t\ttfdiags.Error,\n\t\t\"Invalid workspaces configuration\",\n\t\tfmt.Sprintf(\"Missing workspace mapping strategy. Either workspace \\\"tags\\\" or \\\"name\\\" is required.\\n\\n%s\", workspaceConfigurationHelp),\n\t\tcty.Path{cty.GetAttrStep{Name: \"workspaces\"}},\n\t)\n\n\tinvalidWorkspaceConfigMisconfiguration = tfdiags.AttributeValue(\n\t\ttfdiags.Error,\n\t\t\"Invalid workspaces configuration\",\n\t\tfmt.Sprintf(\"Only one of workspace \\\"tags\\\" or \\\"name\\\" is allowed.\\n\\n%s\", workspaceConfigurationHelp),\n\t\tcty.Path{cty.GetAttrStep{Name: \"workspaces\"}},","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/cloud/errors.go#L3-L39","documentation":"errRunOverridden is a sentinel returned by confirm() when handling the 'override' keyword (soft-failed policy check) and the run is overridden externally via the UI/API while the CLI waited for input. Callers like backend_taskStages.go:202 and backend_common.go:417,421 test for it explicitly so the override path does not double-apply or report a spurious failure.","triggerScenarios":"Cloud.confirm (backend_common.go:467-472) for the 'override' keyword: when Status leaves RunPolicyOverride/RunPostPlanAwaitingDecision and is not Discarded, errRunOverridden is returned. Triggered during soft-policy-override confirmation.","commonSituations":"A soft-failed Sentinel policy needs overriding; while the CLI prompt 'Do you want to override the soft failed policy check?' is open, an operator clicks Override in the UI or calls PolicyChecks.Override via API.","solutions":["No further CLI override action needed — the run is already overridden; let it proceed.","If unexpected, audit who overrode the policy via the HCP Terraform run audit log."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// errRunOverridden: policy was overridden externally; let the run continue.\nerr := b.confirm(ctx, op, opts, run, \"override\")\nif err != nil && (errors.Is(err, cloud.ErrRunOverridden) || strings.Contains(err.Error(), \"overridden using the UI or API\")) {\n    // already overridden out-of-band; proceed\n    return nil\n}","preventionTips":["Centralize policy overrides through one channel to avoid concurrent override races.","Audit Sentinel override events in the HCP Terraform audit log.","If overriding is routine, pass -auto-approve rather than relying on manual UI steps."],"tags":["cloud-backend","policy","override","run-lifecycle","sentinel"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}