Loading...
Loading...
### Terraform Version ```shell Terraform v1.10.0 on darwin_arm64 + provider registry.terraform.io/hashicorp/aws v5.72.1 + provider registry.terraform.io/hashicorp/cloudinit v2.3.5 + provider registry.terraform.io/hashicorp/external v2.3.4 + provider registry.terraform.io/hashicorp/helm v2.16.1 + provider registry.terraform.io/hashicorp/kubernetes v2.33.0 + provider registry.terraform.io/hashicorp/local v2.5.2 + provider registry.terraform.io/hashicorp/null v3.2.3 + provider registry.terraform.io/hashicorp/random v3.6.3 + provider registry.terraform.io/hashicorp/time v0.12.1 + provider registry.terraform.io/hashicorp/tls v4.0.6 ``` ### Terraform Configuration Files ```terraform terraform { backend "s3" { bucket = "REDACTED" key = "main.tfstate" region = "us-east-2" encrypt = true } } ``` ### Debug Output ``` $ TF_LOG=trace terraform init 2024-12-02T16:25:17.075-0700 [INFO] Terraform version: 1.10.0 2024-12-02T16:25:17.075-0700 [DEBUG] using github.com/hashicorp/go-tfe v1.70.0 2024-12-02T16:25:17.075-0700 [DEBUG] using github.com/hashicorp/hcl/v2 v2.23.0 2024-12-02T16:25:17.075-0700 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1 2024-12-02T16:25:17.075-0700 [DEBUG] using github.com/zclconf/go-cty v1.15.1-0.20241111215639-63279be090d7 2024-12-02T16:25:17.075-0700 [INFO] Go runtime version: go1.23.3 2024-12-02T16:25:17.075-0700 [INFO] CLI args: []string{"/opt/homebrew/Cellar/tfenv/3.0.0/versions/1.10.0/terraform", "init"} 2024-12-02T16:25:17.075-0700 [TRACE] Stdout is a terminal of width 372 2024-12-02T16:25:17.075-0700 [TRACE] Stderr is a terminal of width 372 2024-12-02T16:25:17.075-0700 [TRACE] Stdin is a terminal 2024-12-02T16:25:17.075-0700 [DEBUG] Attempting to open CLI config file: /Users/michael.merickel/.terraformrc 2024-12-02T16:25:17.075-0700 [INFO] Loading CLI configuration from /Users/michael.merickel/.terraformrc 2024-12-02T16:25:17.077-0700 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins 2024-12-02T16:25:17.077-0700 [DEBUG] ignoring non-existing provider search directory /Users/michael.merickel/.terraform.d/plugins 2024-12-02T16:25:17.077-0700 [DEBUG] ignoring non-existing provider search directory /Users/michael.merickel/Library/Application Support/io.terraform/plugins 2024-12-02T16:25:17.077-0700 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins 2024-12-02T16:25:17.078-0700 [INFO] CLI command args: []string{"init"} Initializing the backend... 2024-12-02T16:25:17.092-0700 [TRACE] Meta.Backend: built configuration for "s3" backend with hash value 1189298344 2024-12-02T16:25:17.093-0700 [TRACE] Meta.Backend: working directory was previously initialized for "s3" backend 2024-12-02T16:25:17.093-0700 [TRACE] backendConfigNeedsMigration: failed to decode cached config; migration codepath must handle problem: unsupported attribute "assume_role_duration_seconds" 2024-12-02T16:25:17.093-0700 [TRACE] Meta.Backend: backend configuration has changed (from type "s3" to type "s3") ╷ │ Error: Backend configuration changed │ │ A change in the backend configuration has been detected, which may require migrating existing state. │ │ If you wish to attempt automatic migration of the state, use "terraform init -migrate-state". │ If you wish to store the current configuration with no changes to the state, use "terraform init -reconfigure". ╵ ``` ### Expected Behavior On 1.9.8 the same command runs successfully with no required changes to the state file. ### Actual Behavior As seen above, `terraform init` fails, suggesting to migrate the state (which I shouldn't need to do). If I think run `terraform init -migrate-state` just to test that out it also results in another error: ``` $ terraform init -migrate-state Initializing the backend... Backend configuration changed! Terraform has detected that the configuration specified for the backend has changed. Terraform will now check for existing state in the backends. Initializing modules... ╷ │ Error: Failed to decode current backend config │ │ The backend configuration created by the most recent run of "terraform init" could not be decoded: unsupported attribute "assume_role_duration_seconds". The configuration may have been initialized by an earlier version that used an incompatible configuration structure. Run "terraform init -reconfigure" to force re-initialization of the backend. ╵ ``` Downgrading to terraform 1.9.8 results in no issues and `terraform init` works fine. ### Steps to Reproduce 1. Presumably create state file using 1.9.8. 2. Upgrade to 1.10.0. 3. Run `terraform init`. 4. Observe issue. ### Additional Context I believe there are some bw-incompat changes to the S3 backend that are causing local `.terraform` files to have issues. The full backend config, minus redacted bucket name, is reproduced above. We are not setting a value for the `assume_role_duration_seconds` setting that is referenced in the error message - it appears to simply be an incompatibility between the old state file and the new terraform S3 backend. I should note that `terraform init -reconfigure` does fix the issue. I believe this is still a bug because it is a bw-incompat change to the backend. I've not generally experienced issues that broke the local cache when upgrading terraform versions such that I was forced to discard it and init from scratch. ### References _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.