{"record":{"id":"a21aee852d1b38e1","repo":"hashicorp/terraform","slug":"the-remote-backend-does-not-support-the-q-ope","errorCode":null,"errorMessage":"\n\nThe \"remote\" backend does not support the %q operation.","messagePattern":"\n\nThe \"remote\" backend does not support the %q operation\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote/backend.go","lineNumber":803,"sourceCode":"\t\treturn b.local.Operation(ctx, op)\n\t}\n\n\t// Set the remote workspace name.\n\top.Workspace = w.Name\n\n\t// Determine the function to call for our operation\n\tvar f func(context.Context, context.Context, *backendrun.Operation, *tfe.Workspace) (*tfe.Run, error)\n\tswitch op.Type {\n\tcase backendrun.OperationTypePlan:\n\t\tf = b.opPlan\n\tcase backendrun.OperationTypeApply:\n\t\tf = b.opApply\n\tcase backendrun.OperationTypeRefresh:\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"\\n\\nThe \\\"refresh\\\" operation is not supported when using the \\\"remote\\\" backend. \" +\n\t\t\t\t\"Use \\\"terraform apply -refresh-only\\\" instead.\")\n\tdefault:\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"\\n\\nThe \\\"remote\\\" backend does not support the %q operation.\", op.Type)\n\t}\n\n\t// Lock\n\tb.opLock.Lock()\n\n\t// Build our running operation\n\t// the runninCtx is only used to block until the operation returns.\n\trunningCtx, done := context.WithCancel(context.Background())\n\trunningOp := &backendrun.RunningOperation{\n\t\tContext:   runningCtx,\n\t\tPlanEmpty: true,\n\t}\n\n\t// stopCtx wraps the context passed in, and is used to signal a graceful Stop.\n\tstopCtx, stop := context.WithCancel(ctx)\n\trunningOp.Stop = stop\n","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/backend/remote/backend.go#L785-L821","documentation":"Default branch of the operation-type switch in Remote.Operation. Any operation type that is not OperationTypePlan, OperationTypeApply, or OperationTypeRefresh (the latter having its own dedicated error) falls through to this generic 'unsupported operation' rejection.","triggerScenarios":"op.Type is an operation kind the remote backend never implemented (e.g. OperationTypeImport, OperationTypeTaint/Untaint, or a future/custom operation type) being routed through Remote.Operation.","commonSituations":"Programmatic use of the backend API passing an unsupported OperationType; running a command the remote backend doesn't support; version skew where a newer CLI op type isn't handled by the older backend.","solutions":["Use only the supported operations (plan, apply) with the remote backend.","For import/taint/state operations, perform them against a local-state backend or use the 'cloud' backend which has broader support.","Upgrade the Terraform CLI / backend to a version that supports the operation."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// Guard the operation type before calling Remote.Operation.\nfunc supportedByRemote(op backendrun.OperationType) bool {\n    switch op {\n    case backendrun.OperationTypePlan, backendrun.OperationTypeApply, backendrun.OperationTypeRefresh:\n        return true\n    }\n    return false\n}","typeGuard":"func isRemoteSupportedOp(op backendrun.OperationType) bool {\n    return op == backendrun.OperationTypePlan || op == backendrun.OperationTypeApply || op == backendrun.OperationTypeRefresh\n}","tryCatchPattern":null,"preventionTips":["Maintain an allow-list of supported operations per backend in orchestrator code.","Prefer the 'cloud' backend when broader operation coverage is needed.","Unit-test programmatic callers against the full operation-type enum."],"tags":["backend","remote-backend","operation","unsupported","go"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}