-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Terraform generates different hashes for providers when use -plugin-dir parameter #35732
Comments
Hi @S0meth1ng85, Thanks for filing the issue. The log output you included looks as it should be expected, so I'm not sure exactly what we're looking for here. Can you show the actual lock files with the different hashes? |
@jbardin , I have updated my original post and added terraform.lock.hcl files for both variants |
Hi @S0meth1ng85, I don't see any reason the provider data should return a different hash depending on the location, given that both locations contain the exact same data. Exactly how are you creating the directory of providers? |
I have such folders structure: And I pass this providers folder using -plugin-dir Yesterday, I I really do not know what is wrong with my binaries.. I think, for now we can close this issue. Sorry for disturbing you |
It doesn't look like you copied the entire directory structure, newer provider releases contain a |
Terraform Version
Terraform Configuration Files
Debug Output
terraform init -upgrade --backend=false
https://gist.github.com/S0meth1ng85/4729352ef8ce74b650c936ac36e3a5e5
terraform init -plugin-dir="path_to_providers" -upgrade --backend=false
https://gist.github.com/S0meth1ng85/26a07c61e9cdceb4d0c14db55158d8b3
Expected Behavior
terraform init -plugin-dir="path_to_providers" -upgrade --backend=false and terraform init -upgrade --backend=false should generate the same h1 hashes in terraform.lock.hcl file
Actual Behavior
When I run terraform init -upgrade --backend=false in Windows, Terraform downloads binaries for the providers configured in versions.tf and generates terraform.lock.hcl with h1 and zh hashes.
Then I copy terraform providers binaries to a separate folder, delete .terraform system folder, delete terraform.lock.hcl and trying to run terraform init -plugin-dir="path_to_providers" -upgrade --backend=false
In that case terraform generates a new terraform.lock.hcl file which has different h1 hashes for the same providers versions and the same binary files which have been downloaded previously by Terraform. And only this terraform.lock.hcl then works during pipeline run.
We have Windows pipeline agents which prebuild with appropriate terraform version and providers binaries which we use. Git repository of the project includes terraform.lock.hcl for each part of out Terraform blueprint.
Everything is ok with the rest of terraform.lock.hcl files which we generate using terraform init -upgrade --backend=false from Linux, for example. But one part of blueprint which we run on Windows agents do not work with terraform.lock.hcl and instead we need to generate this file using terraform init -plugin-dir="path_to_providers" -upgrade --backend=false.
I am 100% sure that the binaries are the same. We copy binaries from .terraform/providers folder
Steps to Reproduce
terraform init -upgrade --backend=false
in Windowsterraform init -plugin-dir="path_to_providers_binaries" -upgrade --backend=false
Additional Context
No response
References
No response
The text was updated successfully, but these errors were encountered: