Loading...
Loading...
### Terraform Version ```shell 1.10.1 ``` ### Terraform Configuration Files ```terraform terraform { backend "s3" { bucket = "your-bucket" region = "us-east-1" encrypt = true dynamodb_table = "your-stack-locks" key = "your-stack/terraform.tfstate" } } ``` ### Debug Output ```hcl $ TF_LOG=trace terraform init 2024-12-07T21:49:39.474Z [INFO] Terraform version: 1.10.1 2024-12-07T21:49:39.474Z [DEBUG] using github.com/hashicorp/go-tfe v1.70.0 2024-12-07T21:49:39.474Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.23.0 2024-12-07T21:49:39.474Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1 2024-12-07T21:49:39.474Z [DEBUG] using github.com/zclconf/go-cty v1.15.1-0.20241111215639-63279be090d7 2024-12-07T21:49:39.474Z [INFO] Go runtime version: go1.23.3 2024-12-07T21:49:39.475Z [INFO] CLI args: []string{"terraform", "init"} 2024-12-07T21:49:39.475Z [TRACE] Stdout is a terminal of width 291 2024-12-07T21:49:39.475Z [TRACE] Stderr is a terminal of width 291 2024-12-07T21:49:39.475Z [TRACE] Stdin is a terminal 2024-12-07T21:49:39.475Z [DEBUG] Attempting to open CLI config file: /home/devops/.terraformrc 2024-12-07T21:49:39.475Z [DEBUG] File doesn't exist, but doesn't need to. Ignoring. 2024-12-07T21:49:39.476Z [DEBUG] ignoring non-existing provider search directory terraform.d/plugins 2024-12-07T21:49:39.476Z [DEBUG] ignoring non-existing provider search directory /home/devops/.terraform.d/plugins 2024-12-07T21:49:39.476Z [DEBUG] ignoring non-existing provider search directory /home/devops/.local/share/terraform/plugins 2024-12-07T21:49:39.476Z [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins 2024-12-07T21:49:39.477Z [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins 2024-12-07T21:49:39.478Z [INFO] CLI command args: []string{"init"} Initializing the backend... 2024-12-07T21:49:39.484Z [TRACE] Meta.Backend: built configuration for "s3" backend with hash value 3549647693 2024-12-07T21:49:39.484Z [TRACE] Meta.Backend: working directory was previously initialized for "s3" backend 2024-12-07T21:49:39.484Z [TRACE] backendConfigNeedsMigration: failed to decode cached config; migration codepath must handle problem: unsupported attribute "assume_role_duration_seconds" 2024-12-07T21:49:39.484Z [TRACE] Meta.Backend: backend configuration has changed (from type "s3" to type "s3") Initializing modules... 2024-12-07T21:49:39.484Z [TRACE] ModuleInstaller: installing child modules for . into .terraform/modules 2024-12-07T21:49:39.487Z [DEBUG] Module installer: begin eks_main 2024-12-07T21:49:39.503Z [TRACE] ModuleInstaller: Module installer: eks_main already installed in .terraform/modules/eks_main 2024-12-07T21:49:39.503Z [DEBUG] Module installer: begin eks_main.cicd_bastion 2024-12-07T21:49:39.505Z [TRACE] ModuleInstaller: Module installer: eks_main.cicd_bastion already installed in /home/devops/kimera-cli/terraform/eks-main/cicd-bastion 2024-12-07T21:49:39.505Z [DEBUG] Module installer: begin eks_main.cloudwatch_agent_irsa 2024-12-07T21:49:39.507Z [TRACE] ModuleInstaller: Module installer: eks_main.cloudwatch_agent_irsa already installed in /home/devops/kimera-cli/terraform/eks-main/irsa 2024-12-07T21:49:39.507Z [DEBUG] Module installer: begin eks_main.eks_cluster 2024-12-07T21:49:39.552Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster 20.8.5 already installed in .terraform/modules/eks_main.eks_cluster 2024-12-07T21:49:39.553Z [DEBUG] Module installer: begin eks_main.eks_cluster.eks_managed_node_group 2024-12-07T21:49:39.575Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster.eks_managed_node_group already installed in .terraform/modules/eks_main.eks_cluster/modules/eks-managed-node-group 2024-12-07T21:49:39.575Z [DEBUG] Module installer: begin eks_main.eks_cluster.eks_managed_node_group.user_data 2024-12-07T21:49:39.579Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster.eks_managed_node_group.user_data already installed in .terraform/modules/eks_main.eks_cluster/modules/_user_data 2024-12-07T21:49:39.579Z [DEBUG] Module installer: begin eks_main.eks_cluster.fargate_profile 2024-12-07T21:49:39.583Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster.fargate_profile already installed in .terraform/modules/eks_main.eks_cluster/modules/fargate-profile 2024-12-07T21:49:39.583Z [DEBUG] Module installer: begin eks_main.eks_cluster.kms 2024-12-07T21:49:39.591Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster.kms 2.1.0 already installed in .terraform/modules/eks_main.eks_cluster.kms 2024-12-07T21:49:39.591Z [DEBUG] Module installer: begin eks_main.eks_cluster.self_managed_node_group 2024-12-07T21:49:39.623Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster.self_managed_node_group already installed in .terraform/modules/eks_main.eks_cluster/modules/self-managed-node-group 2024-12-07T21:49:39.623Z [DEBUG] Module installer: begin eks_main.eks_cluster.self_managed_node_group.user_data 2024-12-07T21:49:39.624Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster.self_managed_node_group.user_data already installed in .terraform/modules/eks_main.eks_cluster/modules/_user_data 2024-12-07T21:49:39.624Z [DEBUG] Module installer: begin eks_main.eks_cluster_auth 2024-12-07T21:49:39.625Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster_auth 20.8.5 already installed in .terraform/modules/eks_main.eks_cluster_auth/modules/aws-auth 2024-12-07T21:49:39.625Z [DEBUG] Module installer: begin eks_main.eks_cluster_autoscaler 2024-12-07T21:49:39.636Z [TRACE] ModuleInstaller: Module installer: eks_main.eks_cluster_autoscaler 2.2.0 already installed in .terraform/modules/eks_main.eks_cluster_autoscaler 2024-12-07T21:49:39.636Z [DEBUG] Module installer: begin eks_main.gen_deployment_config_files 2024-12-07T21:49:39.639Z [TRACE] ModuleInstaller: Module installer: eks_main.gen_deployment_config_files 0.5.1 already installed in .terraform/modules/eks_main.gen_deployment_config_files 2024-12-07T21:49:39.639Z [DEBUG] Module installer: begin eks_main.gen_testing_config_files 2024-12-07T21:49:39.642Z [TRACE] ModuleInstaller: Module installer: eks_main.gen_testing_config_files 0.5.1 already installed in .terraform/modules/eks_main.gen_testing_config_files 2024-12-07T21:49:39.642Z [DEBUG] Module installer: begin eks_main.get_cluster_helm_configs 2024-12-07T21:49:39.643Z [TRACE] ModuleInstaller: Module installer: eks_main.get_cluster_helm_configs already installed in .terraform/modules/eks_main.get_cluster_helm_configs 2024-12-07T21:49:39.643Z [DEBUG] Module installer: begin eks_main.vpc 2024-12-07T21:49:39.724Z [TRACE] ModuleInstaller: Module installer: eks_main.vpc 5.8.1 already installed in .terraform/modules/eks_main.vpc 2024-12-07T21:49:39.724Z [DEBUG] Module installer: begin eks_main.vpc_endpoints 2024-12-07T21:49:39.731Z [TRACE] ModuleInstaller: Module installer: eks_main.vpc_endpoints 5.8.1 already installed in .terraform/modules/eks_main.vpc_endpoints/modules/vpc-endpoints 2024-12-07T21:49:39.731Z [TRACE] modsdir: writing modules manifest to .terraform/modules/modules.json ╷ │ 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 terraform init should just work with 1.10 after upgrading from 1.8 and 1.9. I'm guessing upgrading to 1.10 from any earlier before 1.8 will have same issue but I did not check. ### Actual Behavior It aborts with a confusing and unsettling error message: ``` │ 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". ``` When I saw that at first, I wasn't sure which one I should pick, since obviously I had not changed anything to the backend config that could guide me in choosing the correct action. After web search I was lucky to find #36150. Turns out `-reconfigure` is required, in both directions: pre-1.10 to 1.10, and back from 1.10 to prior version. Since 1.10 is a minor release, I'm reporting the requirement for `-reconfigure` as a bug: - Our ci/cd is broken: every one and every system that uses terraform has to be upgraded to 1.10. This never used to be the case for minor releases, eg I could be running 1.8 on my system and 1.9 in ci/cd, or vice versa. - So we have to manually run the init with `-reconfigure` from a machine so that the state in s3 gets updated, then the terraform that runs in ci/cd has to also be upgraded to 1.10 otherwise it will give the same init error (and we can't skip the init -- the plan will fail saying init is required). - If there is any issue with upgrade to 1.10 and we have to revert to 1.9 or 1.8, we will also require a manual `-reconfigure`. From that other issue #36150, this seems to happen because tf is doing some cleanup of state for obsolete args. I am all for cleanups, but terraform 1.10 should not do this automatically as part of a minor release, it should be optional so we can do this as a separate action. If this were a major release, sure. But on a minor release, this SHOULD BE CONSIDERED A BUG. Instead a new command line switch eg, so that we can do this cleanup when we are ready, eg we should be able to wait for the next major release even if that happens in 2 years. Make the cleanup mandatory only for major release (tf 2.0). ### Steps to Reproduce This is already documented in the other ticket, but I'll repeat here: 1. create folder with main.tf, put anything you want in it, and the backend pointing to s3 per above 2. intstall tf 1.8 or 1.9 3. tf init 4. now upgrade to tf 1.10 (eg, `tfswitch --latest-stable 1.10`) 5. tf init: see the confusing error ### Additional Context _No response_ ### References - #36150 - #5877
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.