【问题标题】:Running chef-solo gives HTTPServerException 404 "Not Found运行 chef-solo 给出 HTTPServerException 404 "Not Found
【发布时间】:2023-03-04 02:57:01
【问题描述】:

我正在尝试由厨师提供虚拟机。我已经编写了 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"

文件已正确放置。 当尝试再次运行厨师脚本时,这是成功的。 它在交替运行时失败。有什么我可能遗漏的吗?

【问题讨论】:

  • 下一个资源声明是什么?另外,能否请您用更多日志更新上述错误?
  • 在您提供的 sn-p 中,所有内容都用# 注释,那么您希望运行什么?信息太少,不清楚
  • 没有太多日志,除了 404 not found 这是在下一次运行时解决的备用运行。
  • @MohitArora - 您能否更新一下您在配方中调用的下一个资源,即“default.rb”?

标签: vagrant chef-infra chef-recipe chef-solo


【解决方案1】:

假设您实际上没有将其注释掉,请确保您在食谱中的 files/etc_hosts 处具有文件内容。

【讨论】:

  • 我确实有。而且它在备用运行中也成功了。它间歇性地失败
  • 所见即所得,如果它说文件不存在,那么它可能不存在。检查您用于同步独奏文件的任何系统。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-18
  • 2013-03-10
  • 2012-12-22
  • 2017-11-25
  • 2013-11-11
相关资源
最近更新 更多