我加入了一家新公司,为了跟上进度,我一直在为我的 VM 使用 Vagrant。我的系统几乎设置好了,然后一个奇怪的错误迫使我关闭了我的笔记本电脑而没有通过vagrant destroy
. 现在,当尝试设置时,我运行vagrant up
并收到以下错误消息。
[default] Running provisioner: Vagrant::Provisioners::ChefClient...
[default] Creating folder to hold client key...
[default] Uploading chef client validation key...
[default] Generating chef JSON and uploading...
[default] Running chef-client...
stdin: is not a tty
[Wed, 16 Jan 2013 05:20:20 -0500] INFO: *** Chef 0.10.2 ***
[Wed, 16 Jan 2013 05:20:20 -0500] INFO: Client key /etc/chef/client.pem is not present - registering
[Wed, 16 Jan 2013 05:20:21 -0500] INFO: HTTP Request Returned 409 Conflict: Client already exists.
[Wed, 16 Jan 2013 05:20:22 -0500] INFO: HTTP Request Returned 403 Forbidden: Merb::ControllerExceptions::Forbidden
[Wed, 16 Jan 2013 05:20:22 -0500] FATAL: Stacktrace dumped to /srv/chef/file_store/chef-stacktrace.out
[Wed, 16 Jan 2013 05:20:22 -0500] FATAL: Net::HTTPServerException: 403 "Forbidden"
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chef-client -c /tmp/vagrant-chef-1/client.rb -j /tmp/vagrant-chef-1/dna.json
现在根据我自己的研究,我发现这意味着已经存在指定名称的客户端,因此我决定手动将其关闭。我试图列出所有的刀客户,knife client list
但随后收到以下消息:
WARNING: No knife configuration file found
ERROR: Your private key could not be loaded from /etc/chef/client.pem
Check your configuration file and ensure that your private key is readable
奇怪的。我知道knife.rb 存在,当我看到它时ls
,我不知道knife 配置文件怎么不存在。如果没有这个私钥,我显然看不到我的刀客。我对 Vagrant、Knife 和 Chef 完全陌生,所以我很难过。
想法?