-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Closed
Labels
confirmeda Terraform Core team member has reproduced this issuea Terraform Core team member has reproduced this issuedocumentationexplaineda Terraform Core team member has described the root cause of this issue in codea Terraform Core team member has described the root cause of this issue in code
Description
Terraform 0.13 commands cannot be run on a state file created under Terraform 0.12 with a non-default name, because the provider FQNs are not migrated.
Terraform Version
terraform012
: 0.12.29
terraform013
: 189f9fa (0.13.1-dev)
Terraform Configuration Files
resource null_resource "foo" {
}
Steps to Reproduce
terraform012 init
terraform012 apply -state=foo
terraform013 init
terraform013 apply -state=foo
Expected Behavior
All commands should be successful.
Without -state=foo
, i.e. using the default state file name, this works.
Actual Behavior
Init is successful, but final apply is not:
❤ @up ➜ tfbug $GOPATH/bin/terraform apply -state=foo
Error: Could not load plugin
Plugin reinitialization required. Please run "terraform init".
Plugins are external binaries that Terraform uses to access and manipulate
resources. The configuration provided requires plugins which can't be located,
don't satisfy the version constraints, or are otherwise incompatible.
Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints, run "terraform providers".
Failed to instantiate provider "registry.terraform.io/-/null" to obtain
schema: unknown provider "registry.terraform.io/-/null"
All other commands involving the state file, such as terraform show foo
, also fail.
State file
After performing all four steps, the state file is:
❤ @up ➜ tfbug cat foo
{
"version": 4,
"terraform_version": "0.12.29",
"serial": 1,
"lineage": "f88b2c1c-b8ee-ab86-f4b5-0bd49bda07fd",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "null_resource",
"name": "foo",
"provider": "provider.null",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "5921273781850838351",
"triggers": null
},
"private": "bnVsbA=="
}
]
}
]
}
This is despite the correct provider being present in the .terraform
directory as detected from config.
Metadata
Metadata
Assignees
Labels
confirmeda Terraform Core team member has reproduced this issuea Terraform Core team member has reproduced this issuedocumentationexplaineda Terraform Core team member has described the root cause of this issue in codea Terraform Core team member has described the root cause of this issue in code