{"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":"exception","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/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/cloud/backend_plan.go#L344-L380","documentation":"Thrown by Cloud.AssertImportCompatible when the parsed HCP Terraform Agent version is less than 1.10. Even if the API supports import (>= 2.6), the agent itself must be >= 1.10 to handle configuration-driven import blocks. This is the agent-side version floor, checked after the API and env-var checks pass.","triggerScenarios":"Import blocks present, TFC_RUN_ID set, API >= 2.6, TFC_AGENT_VERSION present and parseable, but the parsed agent version is < 1.10. The agent runtime is too old to execute import blocks.","commonSituations":"HCP Terraform Agent deployment pinned to a pre-1.10 image; an organization that hasn't upgraded its agent pools; a dev/test agent image built from an older release tag.","solutions":["Upgrade the HCP Terraform Agent to version 1.10 or later.","Remove import blocks from the configuration and use `terraform import` CLI instead.","If running multiple agent pools, ensure the workspace is assigned to an upgraded pool."],"exampleFix":"// before - agent 1.9 with import blocks fails\nimport {\n  to = aws_instance.example\n  id = \"i-1234567890abcdef0\"\n}\n// after - upgrade agent image to >= 1.10, or remove the import block","handlingStrategy":"validation","validationCode":"// Confirm agent version >= 1.10 before allowing import blocks.\nfloor, _ := version.NewVersion(\"1.10\")\nif v, err := version.NewVersion(os.Getenv(\"TFC_AGENT_VERSION\")); err == nil && v.LessThan(floor) {\n    // reject import blocks\n}","typeGuard":"func agentSupportsImport(agentVersion string) bool {\n    v, err := version.NewVersion(agentVersion)\n    if err != nil { return false }\n    floor, _ := version.NewVersion(\"1.10\")\n    return !v.LessThan(floor)\n}","tryCatchPattern":null,"preventionTips":["Upgrade agent pools to >= 1.10.","Assign import-using workspaces to upgraded pools only.","Use CLI import until all agents meet the floor."],"tags":["terraform","import","hcp-terraform-agent","version-check","remote-execution"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}