{"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/c9def3e214014c1188faabfc4a5bde5095139765/internal/backend/remote/backend.go#L785-L821","documentation":"The default branch of Operation()'s switch on op.Type: any operation type that is not Plan, Apply, or Refresh. It signals the remote backend does not implement that operation kind. In practice this is rarely hit because the CLI only queues known operation types, but it guards against unknown/unimplemented operation types.","triggerScenarios":"An operation type outside the supported set (e.g. a future or internal OperationType constant) reaches Operation(); the switch has no case for it and falls to default.","commonSituations":"Running an unsupported or experimental subcommand against the remote backend; a code change introduced a new OperationType not yet wired into the remote backend; embedding the backend in custom tooling that passes an op.Type the backend doesn't handle.","solutions":["Use a supported operation: plan or apply (refresh is explicitly rejected with its own message; use apply -refresh-only).","If embedding the backend in Go code, only pass backendrun.OperationTypePlan or OperationTypeApply.","Check for a terraform version mismatch where a newer CLI sends an op type this backend version doesn't recognize — align CLI/backend versions."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"switch op.Type {\ncase backendrun.OperationTypePlan, backendrun.OperationTypeApply:\n    // proceed\ndefault:\n    return fmt.Errorf(\"unsupported operation: %s\", op.Type)\n}","typeGuard":"func isSupportedOp(t backendrun.OperationType) bool {\n    switch t {\n    case backendrun.OperationTypePlan, backendrun.OperationTypeApply:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["When embedding the backend, only queue OperationTypePlan or OperationTypeApply.","Keep the CLI/backend versions aligned so new op types are recognized.","Add a unit test asserting supported operation types for your integration."],"tags":["operation","configuration","version"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}