Vagrant 运行chef solo会产生HTTPServerException 404;找不到

Vagrant 运行chef solo会产生HTTPServerException 404;找不到,vagrant,chef-infra,chef-recipe,chef-solo,Vagrant,Chef Infra,Chef Recipe,Chef Solo,我正在尝试由厨师提供VM。我已经编写了default.rb脚本,并保留了要复制到VM的文件 cookbook_file "/etc/hosts" do source "etc_hosts" mode 0644 owner "root" group "root" end end 此操作失败,错误如下 Error executing action `create` on resource 'cookbook_file[/etc/hosts]' ==

我正在尝试由厨师提供VM。我已经编写了default.rb脚本,并保留了要复制到VM的文件

 cookbook_file "/etc/hosts" do
     source "etc_hosts"
     mode 0644
     owner "root"
     group "root"
   end
end
此操作失败,错误如下

 Error executing action `create` on resource 'cookbook_file[/etc/hosts]'
==> default:     ================================================================================
==> default:
==> default:     Net::HTTPServerException
==> default:     ------------------------
==> default:     404 "Not Found"
文件已正确放置。 当再次尝试运行chef脚本时,这是成功的。
它在交替运行时失败。有什么我可能遗漏的吗?

假设您实际上没有注释掉,请确保您在食谱中的
files/etc\u hosts
中有文件内容。

下一个资源语句是什么?另外,您可以用更多日志更新上述错误吗?在您提供的代码段中,所有内容都用
#
注释,那么您希望运行什么呢?信息太少不清楚除了404未找到之外没有太多日志这是在下一次运行的备用运行中解决的。@MohitArora-您能更新配方中下一次调用的资源吗,即“default.rb”?我有。它在备用运行时也会成功。它会间歇性失败。你看到的就是你得到的,如果它说文件不在那里,那么它可能不在那里。检查用于同步solo文件的任何系统。