首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jenkins作业中常量的“错误:无法加载插件:插件重新初始化要求”

Jenkins作业中常量的“错误:无法加载插件:插件重新初始化要求”
EN

Stack Overflow用户
提问于 2022-11-02 08:41:53
回答 1查看 53关注 0票数 -1

我在詹基斯的工作中遇到了这个问题:

代码语言:javascript
复制
+ terraform --version
Terraform v0.15.5

+ rm -rf .terraform/
+ rm -f .terraform.lock.hcl
+ terraform init -upgrade -reconfigure
Upgrading modules...
...

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Finding hashicorp/aws versions matching "~> 3.0"...
- Using hashicorp/aws v3.75.2 from the shared cache directory

...

Terraform has been successfully initialized!

...

+ terraform plan -var-file qa-up.tfvars -out=tfplan
╷
│ Error: Could not load plugin
│ 
│ 
│ Plugin reinitialization required. Please run "terraform init".
│ 
│ Plugins are external binaries that Terraform uses to access and manipulate
│ resources. The configuration provided requires plugins which can't be
│ located,
│ don't satisfy the version constraints, or are otherwise incompatible.
│ 
│ Terraform automatically discovers provider requirements from your
│ configuration, including providers used in child modules. To see the
│ requirements and constraints, run "terraform providers".
│ 
│ failed to instantiate provider "registry.terraform.io/hashicorp/aws" to
│ obtain schema: the cached package for registry.terraform.io/hashicorp/aws
│ 3.75.2 (in .terraform/providers) does not match any of the checksums
│ recorded in the dependency lock file


script returned exit code 1

提供者(当地):

代码语言:javascript
复制
$ terraform providers

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/aws]
└── module.elasticache
    └── provider[registry.terraform.io/hashicorp/aws] ~> 3.0

Providers required by state:

provider[registry.terraform.io/hashicorp/aws]

但是,一旦在本地运行(假设terraform版本也是0.15.5),就没有这样的问题了。它的原因是什么以及如何解决它?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-11-02 11:28:10

当使用多个CPU架构时,往往会出现此问题。terraform init命令将下载底层CPU体系结构的提供程序二进制文件,并创建相应的.terraform.lock.hcl文件。为了使它在混合环境中工作,可以使用一个命令来避免问题1。

代码语言:javascript
复制
terraform providers lock \
  -platform=windows_amd64 \ # 64-bit Windows
  -platform=darwin_amd64 \  # 64-bit macOS
  -platform=linux_amd64     # 64-bit Linux

对于M1 MacOS来说,这将是-platform=darwin_arm64。由于似乎涉及到某种类型的缓存,因此删除旧的锁文件并使用新的锁文件会有所帮助。

1

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74286434

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档