-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
local variables are evaluated before their dependencies from data source have been computed #13299
Comments
I'm not able to reproduce this with 1.11.2, so it seems like a 1.12.0 regression |
Hmm, I see now that this is a feature of 1.12.0:
I guess there are kinks that still need to be ironed out? I will use |
The problem happens inconsistently, so it seems to be some sort of race going on |
|
Hey @torarnv , Thanks for the report, indeed looks like a DAG-related issue here, does I'll investigate this one today, thanks again for bringing this one to our attention |
Thanks @lbajolet-hashicorp ! Yes, |
Awesome, thanks for confirming that the escape hatch does what it's supposed to :) I've been able to reproduce the error you've encountered in my testing, thanks for providing this, very much appreciated! |
Huh, I think I understand the root cause, your Fun one, if you want to make it work with the current dependency methods, I would suggest maybe declaring each local/var you need explicitely in the I'll see what I can do to fix this edge-case. |
Community Note
Overview of the Issue
I have a complex packer build "script", where i have a data source that fetches data from a website. I then have
locals
sections with local variables that reference this data source, and these locals are then referenced in other locals, which in turn are referenced in builders.I'm seeing that sometimes the builds/sources are evaluating the locals before the root data source has been started, resulting in e.g.:
This object does not have an attribute named "vm_name".
I would have expected any evaluation of expressions like
vm_name = local.vm_name
on a source to be deferred until all the dependent variables, including data sources, have been resolved. Is this not the case?Packer version
Packer v1.12.0
The text was updated successfully, but these errors were encountered: