我第一次使用厨师独奏用于配置使用 Vagrant 创建的 Windows 框。
在尝试应用sql_服务器食谱我收到以下错误:
[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
谢谢任何建议。
答案1
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