launchdarkly / terraform-provider-launchdarkly

Terraform LaunchDarkly provider
https://www.terraform.io/docs/providers/launchdarkly/
Mozilla Public License 2.0
22 stars 24 forks source link

Error while installing launchdarkly/launchdarkly v2.12.0: archive has incorrect checksum #145

Closed cakesmith closed 1 year ago

cakesmith commented 1 year ago

As the title mentions, I am receiving this message while attempting to install the provider.

When setting TF_LOG=trace, I receive this message:

2023/04/24 16:23:47 [TRACE] providercache.Dir.InstallPackage: installing registry.terraform.io/launchdarkly/launchdarkly v2.12.0 from https://github.com/launchdarkly/terraform-provider-launchdarkly/releases/download/v2.12.0/terraform-provider-launchdarkly_2.12.0_linux_amd64.zip
2023/04/24 16:23:47 [TRACE] HTTP client GET request to https://github.com/launchdarkly/terraform-provider-launchdarkly/releases/download/v2.12.0/terraform-provider-launchdarkly_2.12.0_linux_amd64.zip
- Installing launchdarkly/launchdarkly v2.12.0...
...

To which I have downloaded that specific file, and the SHA256SUM of it is

 $ shasum -a 256 terraform-provider-launchdarkly_2.12.0_linux_amd64.zip 
914fbd58f7a70dfa5674a365f8c30fafcc21918c926c2c261c1549ed8607c62e  terraform-provider-launchdarkly_2.12.0_linux_amd64.zip

Meanwhile, the SHA256SUM is indicated here as

eff3476e3962e27bde7e2a02089b80410163b17e31c5c1692443ac38c3c120eb  terraform-provider-launchdarkly_2.12.0_linux_amd64.zip

But, the error I receive is this:

Error: Failed to install provider

Error while installing launchdarkly/launchdarkly v2.12.0: archive has
incorrect checksum
zh:ce941faf429fcb79722b2b2e42c889be5017dda7536651b5e4f8f9629e0f4c6c (expected
zh:eff3476e3962e27bde7e2a02089b80410163b17e31c5c1692443ac38c3c120eb)

ERRO[0040] 1 error occurred:
        * exit status 1

To note, this instance of terraform is being executed in a Docker container that is built and run on a Mac M1.

bash-5.0# uname -a
Linux a08c5848c94b 5.10.104-linuxkit #1 SMP PREEMPT Thu Mar 17 17:05:54 UTC 2022 x86_64 GNU/Linux
lucywyman commented 1 year ago

Hmmmm interesting! What's the base image of your Docker container? I just successfully installed the provider directly on my M1 Mac but realized you mean the container is running on an M1 Mac 😅

Looking at the SHAs here the eff3476e3962e27bde7e2a02089b80410163b17e31c5c1692443ac38c3c120eb SHA looks to be correct, and if I download the zip file there I get that SHA too:

$ shasum -a 256 ~/Downloads/terraform-provider-launchdarkly_2.12.0_linux_amd64.zip
eff3476e3962e27bde7e2a02089b80410163b17e31c5c1692443ac38c3c120eb  <redacted>/Downloads/terraform-provider-launchdarkly_2.12.0_linux_amd64.zip

I'm not seeing ce941faf429fcb79722b2b2e42c889be5017dda7536651b5e4f8f9629e0f4c6c or 914fbd58f7a70dfa5674a365f8c30fafcc21918c926c2c261c1549ed8607c62e anywhere in the SHA file either...and am entirely unsure how you're getting the wrong SHA for the file in the release??

Hmm...it's tough to think where to start debugging but I think knowing the base image of the container, the Terraform version, and the Go version in the container is a start?

lucywyman commented 1 year ago

Hmmmm, this StackOverflow post might also be helpful: https://stackoverflow.com/questions/67204811/terraform-failed-to-install-provider-doesnt-match-checksums-from-dependency-l

cakesmith commented 1 year ago

I keep getting 914fbd58f7a70dfa5674a365f8c30fafcc21918c926c2c261c1549ed8607c62e as the SHA256SUM for that file

bash-5.0# shasum -a 256 terraform-provider-launchdarkly_2.12.0_linux_amd64.zip 
914fbd58f7a70dfa5674a365f8c30fafcc21918c926c2c261c1549ed8607c62e  terraform-provider-launchdarkly_2.12.0_linux_amd64.zip

But I don't see it anywhere in the list. The base image of the container is jeinhaus/terragrunt

cakesmith commented 1 year ago

@lucywyman I was hoping it was that I was receiving the darwin binary somehow, but the hash for that is 425ce737afdc581b16615140be4cc819a439270f04e7053fa2afd43a45686237 and I am receiving 914fbd...

cakesmith commented 1 year ago

@lucywyman we are also using Terraform v0.14.11 and Terragrunt v0.35.20

cakesmith commented 1 year ago

This turned out to be a proxy issue, we have a corporate MITM proxy that is apparently is changing the content of our files. We added a rule, and the issue was resolved. Thanks for the fast response!

ldhenry commented 1 year ago

This turned out to be a proxy issue, we have a corporate MITM proxy that is apparently is changing the content of our files. We added a rule, and the issue was resolved. Thanks for the fast response!

Thanks for the update!