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

Data source template_file hangs #10014

Closed
ligustah opened this issue Nov 10, 2016 · 10 comments
Closed

Data source template_file hangs #10014

ligustah opened this issue Nov 10, 2016 · 10 comments

Comments

@ligustah
Copy link

ligustah commented Nov 10, 2016

Terraform Version

v0.7.9

Affected Resource(s)

  • data source template_file

Terraform Configuration Files

https://gist.github.com/sl1pm4t/2d2966d701de7a5c94f8007fee5becfd
( provided by @sl1pm4t )

Debug Output

https://gist.github.com/ligustah/f21d9e18a3f79fd723a3025b537b5540

Expected Behavior

It should apply or stop with an error.

Actual Behavior

It hangs.

Steps to Reproduce

  1. terraform apply

References

https://groups.google.com/d/topic/terraform-tool/fDSkh77gtBY/discussion

@paultyng
Copy link
Contributor

paultyng commented Nov 10, 2016

I'm having a similar problem, I had added a new variable to a template (not a map or list though) and apply just started hanging. When I backed out the change, it started working again.

This was originally in 0.7.9, but I upgraded to 0.7.10 and I still got it.

@chadgrant
Copy link

chadgrant commented Nov 11, 2016

I'm having tons of issues with terraform hanging and leaving no state file, 0.7.5 - 0.7.10. I can't figure out the exact resource that is causing it or I would post the config. TF_LOG_* files show no errors. It just hangs, cntrl-c says "exiting gracefully" nope.. that hangs too.

I highly suspect it to be IAM eventually consistent related issues with ecs_services. I can't tell you how painful it is to keep manually fixing all this stuff it creates with no statefile. PLEASE fix

the only error I get in the log is:

2016/11/11 05:06:13 [ERROR] No DOT origin nodes found.

and it happens right before the template provider ...

@mitchellh
Copy link
Contributor

Hey @paultyng, the issue here is somehow being caused by not escaping the variable in the template_file which should be $${joined_list}. The documentation was updated a few days ago to reflect this and we hope we're very clear about it now. Sorry!

Once you change that, it no longer hangs.

Terraform 0.8 actually will catch this as an error and show it.

@mitchellh
Copy link
Contributor

@chadgrant Also just saw your comment: any hanging issues that we know of I'll prioritize to the top. So please report any (requires a repro though or its hard to fix :(). Note that we're trying to remove hanging as a result of eventual consistency: in TF 0.8 we have a new API providers can opt-in to which allows them to react to Ctrl-C. This will allow hanging API calls to be cancelled for example.

@ligustah
Copy link
Author

@mitchellh I don't use inline templates in the code that triggers this condition, what else might be the cause?

In my "vars" section of the template_file I'm referencing a variable that somehow seems to break stuff and I assume it is the same problem I ran into at another place (when the template didn't work I tried with a normal inline interpolation, which would yield a completely empty string): https://groups.google.com/forum/#!topic/terraform-tool/BNL6085feX0

@ligustah
Copy link
Author

Never mind, I found the error. At one point in the module chain I had something like this:
dns_zone_name = "${dns_zone_name}" (missing the var.- prefix) and apparently this caused the hang and the other issue as well. Sorry for taking your time! (though I'd still suggest that Terraform somehow catches this and provides an error message)

@apparentlymart
Copy link
Contributor

@ligustah there will be an error message for this case in 0.8. The bug in 0.7 is that the variable parsing is allowing these invalid "simple variables" (a single identifier with no periods) but then various parts of Terraform get confused because these variables can never be resolved. In 0.8 these single-identifier references will be a fatal error, but we're waiting for 0.8 because it's a potential backward-compatibility break for those who have been lucky enough to have a situation where this was somewhat-working in spite of it being incorrect.

@ligustah
Copy link
Author

@apparentlymart Thanks for the note! Looking forward to using 0.8 then.

@chadgrant
Copy link

@mitchellh Thanks for responding, the hanging is definitely not related to my terraform config, because it does eventually succeed if I try enough, I'm almost positive it's the eventual consistency issues with AWS or possible race conditions.

@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

No branches or pull requests

6 participants