-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
1.4 - terraform init does not populate .terraform.lock.hcl with hashes for all platforms #32809
Comments
Thanks for this report! |
Hi @twbecker! Thanks for reporting this. Can you share some more information about what you tried? In particular it would be helpful to see the result of running Thanks again! |
Thanks for the response. Here's a gist with the (redacted) trace output: https://gist.github.com/twbecker/46847d3521b20902d7cdf51328e4eb8d |
I'm having a similar problem with Terraform version 1.4.0 on linux_amd64 with the terragrunt wrapper and shared cache, only downgrading to 1.3.9 fixed the issue. I would constantly receive the error:
Running |
Thanks for sharing that, @twbecker. That trace contains the steps I would expect to see as a result of the v1.4 change:
This shows Terraform CLI fetching the official signed signatures for this provider and verifying that the signature is valid, so indeed there doesn't seem to be any reason why the generated lock file shouldn't include all of the checksums from that Just so I can get a sense of all of what you're seeing, can you also share the content of the generated Thanks! |
Hi @samcrop, What you are seeing seems like it might be a little different than what this report was covering. Could you open a new bug report issue and share all of the information requested in the bug report form and then I'll try to see what these two issues have in common. It would also help to share in your new issue the contents of the generated |
Thanks @apparentlymart. Contents of .terraform.lock.hcl:
My understanding is that the |
Hi @twbecker, The Terraform Registry cannot provide Given that, it seems like the behavior you've observed is the intended behavior and that you had an expectation beyond what this change was intended to address. Making Terraform Registry be able to return new-style checksums is the blocker for the extra behavior you wanted here, but that's not something we'll be able to improve only through changes in this repository. (The main challenge is actually not updating the registry itself but rather to change the provider publishing workflows to generate hashes in the new format and include them with releases; each provider codebase has its own publication workflow, so it unfortunately requires every single provider codebase to change before Terraform would be able to record Given that, I think this might be a "working as designed" situation and the remaining work is already represented by #27264, where I wrote a more verbose version of the explanation above about the external factors that are blocking a complete solution. Given that, I'm going to close this just to keep the discussion consolidated over in that existing issue. That issue is the one that will see updates if the situation with the registry protocol and provider signing improves in future. Thanks! |
Thanks for the response. While I appreciate the level of technical detail you provided, what I'm really trying to determine is simply whether or not the lock file I posted will work for users on other platforms. I should point out that although we use the plugin cache, we only do so locally, not across machines. |
After reading the link provided and testing I see that although the generated lock file does work on other platforms, the checksum upgrade behavior means that using it on another platform will result in modifications to the lock file that then have to be checked in. So unfortunately the need to run |
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. |
Terraform Version
Terraform Configuration Files
N/A
Debug Output
N/A
Expected Behavior
According to a comment in #28041:
Actual Behavior
This doesn't seem to be true. Running
terraform init
still only records the h1 checksums for the current platform. This is true regardless of whether a lockfile currently exists or not.Steps to Reproduce
terraform init
Notice any new lockfiles generated only include h1 hashes for the current platform. If there is an existing lockfile, and you-upgrade
d, hashes for other platforms are dropped.Additional Context
From what I can see, Terraform 1.4 behaves identically to 1.3 in this regard, and my main impetus for upgrading was the quoted comment above. My team uses Terraform on multiple platforms with the plugin cache and having to do a
terraform providers lock
after every provider change is terribly error prone.References
terraform init
does not populate.terraform.lock.hcl
with hashes for all platforms #29794The text was updated successfully, but these errors were encountered: