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

Error coming while executing the script: Error: value must be known #843

Closed
jiten-kmar opened this issue Mar 11, 2021 · 11 comments · Fixed by #845
Closed

Error coming while executing the script: Error: value must be known #843

jiten-kmar opened this issue Mar 11, 2021 · 11 comments · Fixed by #845
Labels
bug Something isn't working P1 highest priority issues triaged Scoped and ready for work

Comments

@jiten-kmar
Copy link

jiten-kmar commented Mar 11, 2021

image
Getting the following error when executing Terraform Apply
[9:44 PM] Jitender Kumar

module.gke.random_string.cluster_service_account_suffix: Creating...
module.gke.random_string.cluster_service_account_suffix: Creation complete after 0s [id=qplv]
module.gke.random_shuffle.available_zones: Creating...
module.gke.google_service_account.cluster_service_account[0]: Creating...
module.gke.random_shuffle.available_zones: Creation complete after 0s [id=-]

Error: value must be known

@basphilippus
Copy link

I am also experiencing this issue with version 14.0.0. Pinning the version to 13.1.0 works for me.

@bharathkkb
Copy link
Member

Hi @jitender1278 @basphilippus
Could you share an example config I can use to reproduce the issue

@basphilippus
Copy link

basphilippus commented Mar 11, 2021

Hi @bharathkkb,

I can reproduce the issue with the following config:

main.txt

Let me know if you need anything else.

@jiten-kmar
Copy link
Author

yes, 13.1.0 works but 14.0.0 fails. we should get this fixed

@shanedownes-dmi
Copy link

I started running into this issue recently. In my case, downgrading to 13 alone did not resolve it. I usually use the -out flag on the plan command, and then reference it when applying. When I applied without specifying a pre-generated plan file, it worked as expected.

I suspect that a value is re-evaluated after generating the initial plan. Not sure if it's a bug, or known limitation.

@bharathkkb
Copy link
Member

@basphilippus thanks, I tried https://gist.github.com/bharathkkb/ef9ee3facfcdc93621964f46ebb9a8eb (your example with minimal modifications) and was able to repro for TF 0.14.5, works okay with 0.13.5 which is why our CI did not flag this.

@morgante looks like the issue is the dynamic blueprint name, hardcoding that seems to resolve for 0.14.5

@bharathkkb bharathkkb added bug Something isn't working P1 highest priority issues triaged Scoped and ready for work labels Mar 11, 2021
@rwkarg
Copy link

rwkarg commented Mar 11, 2021

Would it be a good idea to put a cap on the supported terraform version matching the highest version tested in CI?

https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/versions.tf#L23

@morgante
Copy link
Contributor

@bharathkkb Sounds like a core regression, let's file an upstream bug.

@rwkarg We did that historically but the reality is that in the vast majority of cases it is forward-compatible and people complain when you can't use the latest Terraform version.

@bharathkkb
Copy link
Member

@morgante will do, after some more debugging seems to only happen when using a local. A quick fix seems to be to remove the locals and do it inline which seems to work on 0.14.5

module_name = "blueprints/terraform/${join("/", compact([var._parent_module, "terraform-google-kubernetes-engine/v14.0.0"]))}"

@bharathkkb
Copy link
Member

@basphilippus @jitender1278 @rwkarg @shanedownes-dmi release 14.0.1 should contain the fix for this

@jiten-kmar
Copy link
Author

Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 highest priority issues triaged Scoped and ready for work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants