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

Using an attribute in template_file data source hangs when inside a module #10122

Closed
jsonmaur opened this issue Nov 15, 2016 · 2 comments · Fixed by #10134
Closed

Using an attribute in template_file data source hangs when inside a module #10122

jsonmaur opened this issue Nov 15, 2016 · 2 comments · Fixed by #10134

Comments

@jsonmaur
Copy link

jsonmaur commented Nov 15, 2016

Terraform Version

0.7.10

Affected Resource(s)

  • data.template_file

Terraform Configuration Files

main.tf
module "testing" {
  source = "./my-module"
}
my-module/main.tf
data "template_file" "main" {
  template = "$${val}"
  vars {
    val = "${null_resource.main.id}"
  }
}

resource "null_resource" "main" { }

Debug Output

...
2016/11/15 00:54:03 [ERROR] No DOT origin nodes found.
...
2016/11/15 00:54:08 [DEBUG] vertex "meta.count-boundary (count boundary fixup)", waiting for: "module.testing.data.template_file.main"
2016/11/15 00:54:13 [DEBUG] vertex "meta.count-boundary (count boundary fixup)", waiting for: "module.testing.data.template_file.main"

Expected Behavior

It should create the resource and complete the process.

Actual Behavior

It creates the resource, but Terraform completely hangs with the message module.testing.data.template_file.main: Refreshing state.... Pressing ctrl+c shows Interrupt received. Gracefully shutting down..., but still never completes the process. In debug mode, it shows the above "DEBUG" message every 5 seconds. Everything works fine after a second apply.

Steps to Reproduce

  1. terraform get
  2. terraform apply

Works as expected if modules are not used. Could be related to #10014.

@jsonmaur jsonmaur changed the title Resource attributes in data source hangs when in a module Using an attribute in template_file data source hangs when inside a module Nov 15, 2016
mitchellh added a commit that referenced this issue Nov 15, 2016
Fixes #10122

The simple fix was that we forgot to close `ReadDataApply` for the
provider. But I've always felt that this section of the code was brittle
and I wanted to put in a more robust solution. The `shadow.Close` method
uses reflection to automatically close all values.
@mitchellh mitchellh self-assigned this Nov 15, 2016
mitchellh added a commit that referenced this issue Nov 15, 2016
Fixes #10122

The simple fix was that we forgot to close `ReadDataApply` for the
provider. But I've always felt that this section of the code was brittle
and I wanted to put in a more robust solution. The `shadow.Close` method
uses reflection to automatically close all values.
mitchellh added a commit that referenced this issue Nov 15, 2016
Fixes #10122

The simple fix was that we forgot to close `ReadDataApply` for the
provider. But I've always felt that this section of the code was brittle
and I wanted to put in a more robust solution. The `shadow.Close` method
uses reflection to automatically close all values.
mitchellh added a commit that referenced this issue Nov 15, 2016
Fixes #10122

The simple fix was that we forgot to close `ReadDataApply` for the
provider. But I've always felt that this section of the code was brittle
and I wanted to put in a more robust solution. The `shadow.Close` method
uses reflection to automatically close all values.
@jsonmaur
Copy link
Author

Thanks for the quick response! 👍

gusmat pushed a commit to gusmat/terraform that referenced this issue Dec 6, 2016
Fixes hashicorp#10122

The simple fix was that we forgot to close `ReadDataApply` for the
provider. But I've always felt that this section of the code was brittle
and I wanted to put in a more robust solution. The `shadow.Close` method
uses reflection to automatically close all values.
fatmcgav pushed a commit to fatmcgav/terraform that referenced this issue Feb 27, 2017
Fixes hashicorp#10122

The simple fix was that we forgot to close `ReadDataApply` for the
provider. But I've always felt that this section of the code was brittle
and I wanted to put in a more robust solution. The `shadow.Close` method
uses reflection to automatically close all values.
@ghost
Copy link

ghost commented Apr 20, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants