hashicorp/terraform · error
The "remote" backend does not support the
Error message
The "remote" backend does not support the %q operation.
What it means
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.
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.
Defensive patterns
Strategy: type-guard
Validate before calling
// Guard the operation type before calling Remote.Operation.
func supportedByRemote(op backendrun.OperationType) bool {
switch op {
case backendrun.OperationTypePlan, backendrun.OperationTypeApply, backendrun.OperationTypeRefresh:
return true
}
return false
} Type guard
func isRemoteSupportedOp(op backendrun.OperationType) bool {
return op == backendrun.OperationTypePlan || op == backendrun.OperationTypeApply || op == backendrun.OperationTypeRefresh
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- The "refresh" operation is not supported when using the…
- Error asking
- Error creating workspace
- error finding remote workspace
- error loading state
AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11).
Data as JSON: /api/errors/a21aee852d1b38e1.
Report an issue: GitHub.
Appendix: source
Thrown at internal/backend/remote/backend.go:803
return b.local.Operation(ctx, op)
}
// Set the remote workspace name.
op.Workspace = w.Name
// Determine the function to call for our operation
var f func(context.Context, context.Context, *backendrun.Operation, *tfe.Workspace) (*tfe.Run, error)
switch op.Type {
case backendrun.OperationTypePlan:
f = b.opPlan
case backendrun.OperationTypeApply:
f = b.opApply
case backendrun.OperationTypeRefresh:
return nil, fmt.Errorf(
"\n\nThe \"refresh\" operation is not supported when using the \"remote\" backend. " +
"Use \"terraform apply -refresh-only\" instead.")
default:
return nil, fmt.Errorf(
"\n\nThe \"remote\" backend does not support the %q operation.", op.Type)
}
// Lock
b.opLock.Lock()
// Build our running operation
// the runninCtx is only used to block until the operation returns.
runningCtx, done := context.WithCancel(context.Background())
runningOp := &backendrun.RunningOperation{
Context: runningCtx,
PlanEmpty: true,
}
// stopCtx wraps the context passed in, and is used to signal a graceful Stop.
stopCtx, stop := context.WithCancel(ctx)
runningOp.Stop = stop
View on GitHub (pinned to d32a084675)