Details
-
Task
-
Resolution: Unresolved
-
Neutral
-
None
-
None
-
None
-
None
-
Empty show more show less
-
Empty show more show less
-
Yes
Description
Sometimes Jenkins builds failed with the Terraform error like:
13:26:26 ╷
13:26:26 │ Error: Required plugins are not installed
13:26:26 │
13:26:26 │ The installed provider plugins are not consistent with the packages
13:26:26 │ selected in the dependency lock file:
13:26:26 │ - registry.terraform.io/hashicorp/archive: the cached package for registry.terraform.io/hashicorp/archive 2.2.0 (in .terraform/providers) does not match any of the checksums recorded in the dependency lock file
13:26:26 │
13:26:26 │ Terraform uses external plugins to integrate with a variety of different
13:26:26 │ infrastructure services. You must install the required plugins before
13:26:26 │ running Terraform operations.
13:26:26 ╵
There's a probable solution, that suggests the error is caused by:
<<The issue is that my local workstation is a Mac which uses the darwin platform, so all of the providers are downloaded for darwin and the hashes stored in the lockfile for that platform. When the CI system, which is running on Linux runs, it attempts to retrieve the providers listed in the lockfile, but the checksums don't match because they use a different platform.>>
We can check this kind of solution, but then again, also the lock files like the following must be included in VCS?
$ find . -name ".lock"
./magnolia-core-experimental/eu-central-1/magnolia-mgmt-ui/.terragrunt-cache/BI4PwkgML2iC1bYuygGAMDkmgLQ/ZAi6KoCBlp_GK_BvGbKEAVu77II/magnolia-mgmt-ui/.terraform.lock.hcl
./magnolia-core-experimental/eu-central-1/magnolia-mgmt-ui/.terraform.lock.hcl
./magnolia-core-experimental/.terraform.lock.hcl
./magnolia-core-production/eu-central-1/magnolia-mgmt-ui/.terragrunt-cache/R_YCpqSiA6hzGIX2uFUxKzPvISA/ZAi6KoCBlp_GK_BvGbKEAVu77II/magnolia-mgmt-ui/.terraform.lock.hcl
./magnolia-core-production/eu-central-1/magnolia-mgmt-ui/.terraform.lock.hcl
./magnolia-core-production/.terraform.lock.hcl
./.terraform.lock.hcl