{"record":{"id":"e4292152b8a437ed","repo":"hashicorp/terraform","slug":"remote-backend-doesn-t-support-s","errorCode":null,"errorMessage":"remote backend doesn't support %s","messagePattern":"remote backend doesn't support (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backend/remote/backend_plan.go","lineNumber":315,"sourceCode":"\t\tConfigurationVersion: cv,\n\t\tRefresh:              tfe.Bool(op.PlanRefresh),\n\t\tWorkspace:            w,\n\t}\n\n\tswitch op.PlanMode {\n\tcase plans.NormalMode:\n\t\t// okay, but we don't need to do anything special for this\n\tcase plans.RefreshOnlyMode:\n\t\trunOptions.RefreshOnly = tfe.Bool(true)\n\tcase plans.DestroyMode:\n\t\trunOptions.IsDestroy = tfe.Bool(true)\n\tdefault:\n\t\t// Shouldn't get here because we should update this for each new\n\t\t// plan mode we add, mapping it to the corresponding RunCreateOptions\n\t\t// field.\n\t\treturn nil, generalError(\n\t\t\t\"Invalid plan mode\",\n\t\t\tfmt.Errorf(\"remote backend doesn't support %s\", op.PlanMode),\n\t\t)\n\t}\n\n\tif len(op.Targets) != 0 {\n\t\trunOptions.TargetAddrs = make([]string, 0, len(op.Targets))\n\t\tfor _, addr := range op.Targets {\n\t\t\trunOptions.TargetAddrs = append(runOptions.TargetAddrs, addr.String())\n\t\t}\n\t}\n\n\tif len(op.ForceReplace) != 0 {\n\t\trunOptions.ReplaceAddrs = make([]string, 0, len(op.ForceReplace))\n\t\tfor _, addr := range op.ForceReplace {\n\t\t\trunOptions.ReplaceAddrs = append(runOptions.ReplaceAddrs, addr.String())\n\t\t}\n\t}\n\n\tr, err := b.client.Runs.Create(stopCtx, runOptions)","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/backend/remote/backend_plan.go#L297-L333","documentation":"A defensive guard in the plan-mode switch: NormalMode, RefreshOnlyMode and DestroyMode are explicitly mapped to RunCreateOptions; any other plans.Mode value falls into default and aborts. The comment states this should be updated for every new mode added, so hitting it means a code/version skew rather than a user mistake.","triggerScenarios":"A new plans.Mode constant was added to core but the remote backend switch was not updated; an experimentally-enabled plan mode reached the remote backend; a custom/forked build introduced a new mode without backend support.","commonSituations":"Running a fork or unreleased build that adds a plan mode before the TFC run-creation layer supports it; mixing incompatible Terraform core + TFE server versions where the server rejects the implicit mapping.","solutions":["Run plan/apply with a supported mode (default, -refresh-only, or -destroy) against the remote backend.","If you genuinely need the new mode, file an issue / update this switch to map it to the corresponding RunCreateOptions field.","Pin to a Terraform version whose plan-mode set matches the remote backend implementation.","For a local fork, add the case here and verify the TFC RunCreateOptions field exists for it."],"exampleFix":"// before\ncase plans.NormalMode:\ncase plans.RefreshOnlyMode:\ncase plans.DestroyMode:\n// after (after adding support for a hypothetical mode)\ncase plans.SomeNewMode:\n    runOptions.SomeNewFlag = tfe.Bool(true)","handlingStrategy":"validation","validationCode":"// Guard against unsupported plan mode before dispatching to remote backend\nswitch mode {\ncase plans.NormalMode, plans.RefreshOnlyMode, plans.DestroyMode:\n    // ok\ndefault:\n    return fmt.Errorf(\"plan mode %s not supported by remote backend\", mode)\n}","typeGuard":"func isRemoteSupportedMode(m plans.Mode) bool {\n    switch m {\n    case plans.NormalMode, plans.RefreshOnlyMode, plans.DestroyMode:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Treat this guard as a release gate: when adding a plans.Mode, also extend this switch.","Run backend integration tests for each supported mode on every core change.","Pin Terraform version to one whose mode set matches your TFE server."],"tags":["terraform","remote-backend","tfe","plan-mode","version-skew","defensive"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}