Uploaded image for project: 'Build'
  1. Build
  2. BUILD-881

Review Terraform error like "Required plugins are not installed"

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Neutral
    • None
    • None
    • None
    • None

    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

       

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              roberto.gomez Roberto Gomez
              Foundation
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Checklists

                  Task DoR