chef-client错误:Errno :: ENOENT:没有这样的文件或目录@ rb_sysopen-/ etc / chef / chef_guid

问题描述 投票:0回答:1

我们正在使用测试厨房来测试我们的厨师食谱。

在厨房容器中运行厨师客户端时,我看到此错误:

[2020-03-21T07:22:21+00:00] WARN: *****************************************
[2020-03-21T07:22:21+00:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2020-03-21T07:22:21+00:00] WARN: *****************************************
Starting Chef Client, version 14.2.0

Running handlers:
[2020-03-21T07:22:23+00:00] ERROR: Running exception handlers
Running handlers complete
[2020-03-21T07:22:23+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2020-03-21T07:22:23+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2020-03-21T07:22:23+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-03-21T07:22:23+00:00] FATAL: Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/chef_guid

我已经跑过

$ kitchen create
$ kitchen converge

在主机上。

在厨房VM上,目录/ etc / chef不存在。

[root@kitchen-test ~]# ls /etc/chef
ls: cannot access /etc/chef: No such file or directory

我正在尝试在跟踪日志级别模式下运行Chef-client,因为厨房融合没有跟踪日志。厨房融合仅支持调试级别。

版本:

Test Kitchen version 2.3.3 (on host) with dokken driver
Chef: 14.2.0 (in kitchen vm)
chef test-kitchen chef-client
1个回答
0
投票

我有一种在厨房客户端节点上以跟踪模式运行Chef-Client的怪癖方法。

运行厨房融合时,请在/ opt / kitchen中安全的位置备份文件。我选择了/ tmp

rync -av /opt/kitchen /tmp/

通过执行^ C来杀死厨房或使其完成。

/ opt / kitchen的结构应类似于:

[root@node kitchen]# ls -a /tmp/kitchen/
.  ..  cache  chef_guid  client.pem  client.rb  clients  cookbooks  data_bags  dna.json  encrypted_data_bag_secret  environments  nodes  ohai  validation.pem

现在运行零厨师

# /opt/chef/embedded/bin/ruby /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-zero-14.0.6/bin/chef-zero &
(# /opt/chef/embedded/bin/chef-zero & might work too)

将所有内容上传到零厨师服务器

# cd /opt/kitchen
# /opt/chef/embedded/bin/knife upload . --chef-zero-host localhost --chef-zero-port 1 -c client.rb -V

现在以跟踪模式运行chef-client

# /opt/chef/embedded/bin/chef-client -z -l trace -F doc -c /opt/kitchen/client.rb -j /opt/kitchen/dna.json
© www.soinside.com 2019 - 2024. All rights reserved.