{"record":{"id":"2e5e1ce4df096b22","repo":"hashicorp/terraform","slug":"import-blocks-are-not-supported-in-this-version-of-2e5e1c","errorCode":null,"errorMessage":"Import blocks are not supported in this version of the HCP Terraform Agent. You are using agent version %s, but this feature requires version %s. Please remove any import blocks from your config or upgrade your agent.","messagePattern":"Import blocks are not supported in this version of the HCP Terraform Agent\\. You are using agent version (.+?), but this feature requires version (.+?)\\. Please remove any import blocks from your config or upgrade your agent\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloud/backend_plan.go","lineNumber":362,"sourceCode":"\t\t\treturn fmt.Errorf(\"Error parsing remote API version. To proceed, please remove any import blocks from your config. Please report the following error to the Terraform team: %s\", err)\n\t\t}\n\t\tdesiredAPIVersion, _ := version.NewVersion(\"2.6\")\n\t\tif currentAPIVersion.LessThan(desiredAPIVersion) {\n\t\t\treturn fmt.Errorf(\"Import blocks are not supported in this version of Terraform Enterprise. Please remove any import blocks from your config or upgrade Terraform Enterprise.\")\n\t\t}\n\n\t\t// Second, check the agent version is high enough.\n\t\tagentEnv, isSet := os.LookupEnv(\"TFC_AGENT_VERSION\")\n\t\tif !isSet {\n\t\t\treturn fmt.Errorf(\"Error reading HCP Terraform Agent version. To proceed, please remove any import blocks from your config. Please report the following error to the Terraform team: TFC_AGENT_VERSION not present.\")\n\t\t}\n\t\tcurrentAgentVersion, err := version.NewVersion(agentEnv)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error parsing HCP Terraform Agent version. To proceed, please remove any import blocks from your config. Please report the following error to the Terraform team: %s\", err)\n\t\t}\n\t\tdesiredAgentVersion, _ := version.NewVersion(\"1.10\")\n\t\tif currentAgentVersion.LessThan(desiredAgentVersion) {\n\t\t\treturn fmt.Errorf(\"Import blocks are not supported in this version of the HCP Terraform Agent. You are using agent version %s, but this feature requires version %s. Please remove any import blocks from your config or upgrade your agent.\", currentAgentVersion, desiredAgentVersion)\n\t\t}\n\t}\n\treturn nil\n}\n\n// renderPlanLogs reads the streamed plan JSON logs and calls the JSON Plan renderer (jsonformat.RenderPlan) to\n// render the plan output. The plan output is fetched from the redacted output endpoint.\nfunc (b *Cloud) renderPlanLogs(ctx context.Context, op *backendrun.Operation, run *tfe.Run) error {\n\tlogs, err := b.client.Plans.Logs(ctx, run.Plan.ID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif b.CLI != nil {\n\t\treader := bufio.NewReaderSize(logs, 64*1024)\n\n\t\tfor next := true; next; {\n\t\t\tvar l, line []byte","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/cloud/backend_plan.go#L344-L380","documentation":"Raised by AssertImportCompatible when the HCP Terraform Agent version parses but is older than 1.10, the minimum that supports configuration-driven import blocks. The message names the running version and the required version.","triggerScenarios":"import blocks present, TFC_RUN_ID set, API version OK, TFC_AGENT_VERSION parses but currentAgentVersion.LessThan(desired \"1.10\").","commonSituations":"Workspace bound to an agent pool running an older agent image (pre-1.10); import blocks added to a config that previously worked; agent pool not updated after a Terraform core upgrade.","solutions":["Upgrade the HCP Terraform Agent image to version 1.10 or newer (update the agent pool / agent version in HCP).","Remove import blocks from the config and import resources imperatively.","Switch the workspace to local execution or an agent pool with a supported version."],"exampleFix":"// before: workspace pinned to agent v1.8 with import blocks\nimport { to = aws_instance.web  id = \"i-1\" }\n// after: upgrade agent pool to >= 1.10 (UI: Settings -> Agent -> version), then re-run","handlingStrategy":"validation","validationCode":"const minAgent = \"1.10\"\nif cur, err := version.NewVersion(os.Getenv(\"TFC_AGENT_VERSION\")); err == nil {\n    min, _ := version.NewVersion(minAgent)\n    if cur.LessThan(min) {\n        return fmt.Errorf(\"agent %s < %s; upgrade before using import blocks\", cur, minAgent)\n    }\n}","typeGuard":"func agentSupportsImport(agentVer string) bool {\n    cur, e1 := version.NewVersion(agentVer)\n    min, _ := version.NewVersion(\"1.10\")\n    return e1 == nil && !cur.LessThan(min)\n}","tryCatchPattern":null,"preventionTips":["Pin agent pools to >= 1.10 when using import blocks.","Add an upgrade policy for agent images.","Surface agent version in run metadata for auditing."],"tags":["terraform","import-blocks","hcp-agent","upgrade-required","cloud-backend"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T21:17:07.882Z"}