gpt4 book ai didi

chef-infra - "FATAL: Cannot load configuration"在 Chef 客户端之后

转载 作者:行者123 更新时间:2023-12-04 13:57:08 24 4
gpt4 key购买 nike

我正在运行以下命令:

chef-client --local-mode -j deploy-backend.json

JSON 文件包含:
{
"run-list" : [
"deploy-dev::sysprepare",
"deploy-dev::deploybackend",
"deploy-dev::deploynginx"
]
}

现在的问题是:chef-client 命令成功运行,但在运行食谱后,最后出现 fatal error :
$ sudo chef-client --local-mode -j cookbooks/deploy-backend.json 
[2017-07-13T13:19:11+02:00] WARN: No config file found or specified on command line, using command line options.
Starting Chef Client, version 13.2.20
resolving cookbooks for run list: ["deploy-dev::sysprepare", "deploy-dev::deploybackend", "deploy-dev::deploynginx"]
Synchronizing Cookbooks:
- deploy-dev (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 29 resources
Recipe: deploy-dev::sysprepare
...
...
- reload service service[nginx]

Running handlers:
Running handlers complete
Chef Client finished, 11/33 resources updated in 01 minutes 32 seconds
[2017-07-13T13:20:43+02:00] WARN: No config file found or specified on command line, using command line options.
[2017-07-13T13:20:43+02:00] WARN: No config file found or specified on command line, using command line options.
[2017-07-13T13:20:43+02:00] FATAL: Cannot load configuration from cookbooks/deploy-backend.json
[2017-07-13T13:20:43+02:00] FATAL: Cannot load configuration from cookbooks/deploy-backend.json

我省略了大部分输出,“重新加载服务服务[nginx]”是运行列表中的最后一个资源。我已经手动验证了配方运行是否正确,但最后我收到了 fatal error (这是从 CI 作业调用的,因此我的 CI 管道因此而失败)。

这很奇怪,因为食谱的执行很顺利。我正在使用厨师客户端版本 13.2.20。如果我使用 Chef-client 的 12 版,则执行正常。另外,如果我只是通过运行列表:
chef-client --local-mode -r "deploy-dev::sysprepare,deploy-dev::deploybackend,deploy-dev::deploynginx"

它正确执行。有人知道这里发生了什么吗?

最佳答案

你应该使用你的json的完整路径

sudo chef-client --local-mode -j /opt/chef/cookbooks/deploy-backend.json 

关于chef-infra - "FATAL: Cannot load configuration"在 Chef 客户端之后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45079652/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com