【发布时间】:2016-08-05 15:06:52
【问题描述】:
我正在目标节点上从厨师服务器运行厨师引导命令。脚本对于初始配方运行良好,但随着它的进展,我们看到 403 被禁止并退出。此 403 仅在尝试从模板文件夹复制文件时发生。我在执行另一个配方时也遇到了同样的问题。
配方没有问题,因为相同的食谱在不同的目标节点上运行没有问题。
有人知道如何解决这个问题吗?
Error executing action `create` on resource 'template[/tmp/rsp_files/WebGate_Installation_response_file.rsp]'
================================================================================
Net::HTTPServerException
------------------------
403 "Forbidden"
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/ohs/recipes/install_webgate.rb
59: template "#{node['OHS']['RSP_FILE']}/WebGate_Installation_response_file.rsp" do
60: source 'WebGate_Installation_response_file.rsp.erb'
61: owner node['OHS']['USER']
62: group node['OHS']['GROUP']
63: mode '0644'
64: not_if do ::File.exists?("#{node['OHS']['RSP_FILE']}/WebGate_Installation_response_file.rsp") end
65: end
66:
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/ohs/recipes/install_webgate.rb:59:in `from_file'
template("/tmp/rsp_files/WebGate_Installation_response_file.rsp") do
provider Chef::Provider::Template
action "create"
retries 0
retry_delay 2
guard_interpreter :default
path "/tmp/rsp_files/WebGate_Installation_response_file.rsp"
backup 5
atomic_update true
source "WebGate_Installation_response_file.rsp.erb"
cookbook_name "ohs"
recipe_name "install_webgate"
owner "oracle"
group "oinstall"
mode "0644"
not_if { #code block }
end
Running handlers:
[2016-05-31T17:21:45-04:00] ERROR: Running exception handlers
Running handlers complete
[2016-05-31T17:21:45-04:00] ERROR: Exception handlers complete
[2016-05-31T17:21:45-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 23 resources updated in 929.166495413 seconds
[2016-05-31T17:21:45-04:00] ERROR: template[/tmp/rsp_files/WebGate_Installation_response_file.rsp] (ohs::install_webgate line 59) had an error: Net::HTTPServerException: 403 "Forbidden"
[2016-05-31T17:21:45-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
【问题讨论】:
-
您使用的是什么版本的 Chef?
-
您的跑步需要很长时间吗?我认为 11.14 大约是我们默认启用延迟加载模板文件的时间,因此 URL 签名可能会在很长一段时间内过期。您可以通过在
client.rb中将no_lazy_load设置为 true 来解决此问题。 -
你能告诉我在哪里添加 no_lazy_load 吗?它是在厨师客户端还是厨师服务器?我没有 client.rb 的配方。