Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceTransformer hangs in plan when module has depends_on #35154

Closed
ryancragun opened this issue May 13, 2024 · 1 comment · Fixed by #35157
Closed

ReferenceTransformer hangs in plan when module has depends_on #35154

ryancragun opened this issue May 13, 2024 · 1 comment · Fixed by #35157
Assignees

Comments

@ryancragun
Copy link

ryancragun commented May 13, 2024

Terraform Version

Terraform v1.8.3
on darwin_amd64
+ provider registry.terraform.io/hashicorp-forge/enos v0.5.2
+ provider registry.terraform.io/hashicorp/aws v5.49.0
+ provider registry.terraform.io/hashicorp/random v3.6.1

Terraform Configuration Files

A commit containing necessary files for reproduction: https://github.com/hashicorp/vault-enterprise/commit/1f634aea1611faedcf26a4070c4289b0c28f04f2

Debug Output

https://github.com/hashicorp/vault-enterprise/blob/1f634aea1611faedcf26a4070c4289b0c28f04f2/enos/trace.txt

Expected Behavior

The module, with line 550 uncommented, should plan

Actual Behavior

While planning the ReferenceTransformer hangs forever.

2024-05-13T13:41:42.442-0600 [DEBUG] ReferenceTransformer: "module.create_primary_cluster_backend_targets.local.instance_type (expand)" references: [module.create_primary_cluster_backend_targets.local.instance_types (expand) module.create_primary_cluster_backend_targets.data.aws_ami.ami (expand)]
2024-05-13T13:41:42.442-0600 [DEBUG] ReferenceTransformer: "module.verify_secondary_cluster_is_unsealed_after_enabling_replication (close)" references: []

Steps to Reproduce

  1. Check out the reproduction branch
  2. cd enos
  3. Uncomment line 550 in scenario.tf
  4. terraform init
  5. terraform plan

Additional Context

We've found a situtation where a module that plans as expected with
1.7.5 gets stuck planning forever with 1.8.3.

In the enos directory you'll find scenario.tf, which is stripped down
version of the module that is auto-generated.

I bisected to the module that was causing the infinite plan and
then bisected to the depends_on reference in it that causes it:

module "add_additional_nodes_to_primary_cluster" {
  depends_on = [
    module.create_primary_backend_cluster,
    module.create_primary_cluster,
    module.create_primary_cluster_additional_targets,
    module.create_vpc,
    // Uncomment this depends_on and we get stuck building the graph forever
    // module.verify_replicated_data
  ]
  // ...
}

It appears that this explicit depends_on causes our issue. With it left
out both 1.7.5 and 1.8.3 plan as expected.

References

No response

@ryancragun ryancragun added bug new new issue not yet triaged labels May 13, 2024
@jbardin jbardin self-assigned this May 13, 2024
@jbardin jbardin added core and removed new new issue not yet triaged labels May 13, 2024
@hend0012
Copy link

We are experiencing the exact same issue. version 1.8.0 is still working as expected, after that we run into the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants