Chef
執行廚師客戶端時 RedirectLimitExceeded
我第一次使用chef solo來配置一個用 Vagrant 創建的 Windows 盒子。
在嘗試應用sql_server食譜時,我收到以下錯誤:
[2013-11-14T09:41:24+01:00] ERROR: Running exception handlers [2013-11-14T09:41:24+01:00] ERROR: Exception handlers complete [2013-11-14T09:41:24+01:00] FATAL: Stacktrace dumped to C:/var/chef/cache/chef-stacktrace.out [2013-11-14T09:41:24+01:00] FATAL: Chef::Exceptions::RedirectLimitExceeded: windows_package[Microsoft SQL Server 2008 R2 (32-bit)] (sql_server::server line 39) had an error: Chef::Exceptions::RedirectLimitExceeded: remote_file[/var/chef/cache/SQLEXPR32_x86_ENU.exe] (dynamically defined) had an error: Chef::Exceptions::RedirectLimitExceeded: Chef::Exceptions::RedirectLimitExceeded
感謝任何建議。
RedirectLimitExceeded 異常是 remote_file 嘗試檢索的原始 URL 和最終 URL 之間存在過多 DNS 重定向的結果。我遇到了同樣的問題,並通過將原始 URL 更改為它要重定向到的 URL 來解決它,從而消除了使我處於重定向計數之下的重定向。
您可以在此處查看為解決相同問題所做的更改:
-default['openresty']['pcre']['url'] = "http://sourceforge.net/projects/pcre/files/pcre/#{node['openresty']['pcre']['version']}/pcre-#{node['openresty']['pcre']['version']}.tar.bz2/download" +default['openresty']['pcre']['url'] = "http://downloads.sourceforge.net/project/pcre/pcre/#{node['openresty']['pcre']['version']}/pcre-#{node['openresty']['pcre']['version']}.tar.bz2/download"
您可以使用 redirect_limit var 以某種方式設置它,但我還沒有嘗試這樣做。
希望這可以幫助…
編輯:此外,您可以通過執行以下操作在重定向行的下方找到 URL…
$ wget http://sourceforge.net/projects/adium/files/Adium_1.5.7.dmg/download --2014-02-25 19:09:04-- http://sourceforge.net/projects/adium/files/Adium_1.5.7.dmg/download Resolving sourceforge.net... 216.34.181.60 Connecting to sourceforge.net|216.34.181.60|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://downloads.sourceforge.net/project/adium/Adium_1.5.7.dmg?r=&ts=1393373344&use_mirror=hivelocity [following] --2014-02-25 19:09:04-- http://downloads.sourceforge.net/project/adium/Adium_1.5.7.dmg?r=&ts=1393373344&use_mirror=hivelocity Resolving downloads.sourceforge.net... 216.34.181.59 Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://hivelocity.dl.sourceforge.net/project/adium/Adium_1.5.7.dmg [following] --2014-02-25 19:09:04-- http://hivelocity.dl.sourceforge.net/project/adium/Adium_1.5.7.dmg Resolving hivelocity.dl.sourceforge.net... 74.50.101.106 Connecting to hivelocity.dl.sourceforge.net|74.50.101.106|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 23999416 (23M) [application/x-apple-diskimage] Saving to: ‘download’ 100%[===================================================================================================================================>] 23,999,416 1014KB/s in 25s 2014-02-25 19:09:29 (941 KB/s) - ‘download’ saved [23999416/23999416]
這讓我發現我可以改用這個 URL:http: //hivelocity.dl.sourceforge.net/project/adium/Adium_1.5.7.dmg