【发布时间】:2015-10-10 08:19:53
【问题描述】:
已经为这本食谱苦苦挣扎了一段时间。
我正在尝试将包括 Azure SDK 在内的大量资源安装到 Windows Server 2012 R2 实例上。
最初我在堆栈跟踪中收到以下错误:
Generated at 2014-07-01 14:59:23 +0000
Mixlib::ShellOut::ShellCommandFailed: windows_package[WindowsAzureStorageEmulator.msi]
(azure_sdk::default line 29) had an error: Mixlib::ShellOut::ShellCommandFailed:
Expected process to exit with [0, 42, 127], but received '1603'
---- Begin output of msiexec /qn /i "c:\chef\chef-
cache\WindowsAzureStorageEmulator.msi" ----
STDOUT:
STDERR:
---- End output of msiexec /qn /i "c:\chef\chef-cache\WindowsAzureStorageEmulator.msi"
----
我添加了停止、删除、创建和启动的步骤sqllocaldb
但是,现在我收到以下错误:
Generated at 2014-08-02 07:54:19 +0000
Mixlib::ShellOut::ShellCommandFailed: execute[stop-sqllocaldb] (azure_sdk::default line
18) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with
[0], but received '1'
---- Begin output of sqllocaldb stop v11.0 ----
STDOUT:
STDERR: 'sqllocaldb' is not recognized as an internal or external command,operable
program or batch file.
---- End output of sqllocaldb stop v11.0 ----
我怀疑可能存在某种形式的时间问题(即 sqllocaldb 尚未准备好),因为如果我 ssh 到服务器然后重新运行 chef,整个说明书将得到完美处理,并且我的所有资源都已安装。
注意。我尝试使用 retries 属性,但是我不相信 execute 支持此属性。
我将整个食谱包括在下面:
%w{ SqlLocalDB.msi }.each do |pkg|
windows_package "#{pkg}" do
source "https://s3-eu-west-1.amazonaws.com/qainstallerfiles/#{pkg}"
options "IACCEPTSQLLOCALDBLICENSETERMS=YES /qn"
installer_type :custom
action :install
end
end
%w{ WindowsAzureTools.vs140.exe }.each do |pkg|
windows_package "#{pkg}" do
source "https://s3-eu-west-1.amazonaws.com/qainstallerfiles/#{pkg}"
installer_type :nsis
action :install
end
end
execute "stop-sqllocaldb" do
command "sqllocaldb stop v11.0"
retries 5
retry_delay 30
action :run
end
execute "delete-sqllocaldb" do
command "sqllocaldb delete v11.0"
retries 5
retry_delay 30
action :run
end
execute "delete-WAStorageEmulator" do
command "del C:\Users\Administrator\WAStorageEmulatorDb3*.*"
action :run
end
execute "create-sqllocaldb" do
command "sqllocaldb create v11.0"
retries 5
retry_delay 30
action :run
end
execute "start-sqllocaldb" do
command "sqllocaldb start v11.0"
retries 5
retry_delay 30
action :run
end
%w{ WindowsAzureStorageEmulator.msi }.each do |pkg|
windows_package "#{pkg}" do
source "https://s3-eu-west-1.amazonaws.com/qainstallerfiles/#{pkg}"
retries 5
retry_delay 30
action :install
end
end
%w{ WindowsAzureAuthoringTools-x64.msi}.each do |pkg|
windows_package "#{pkg}" do
source "https://s3-eu-west-1.amazonaws.com/qainstallerfiles/#{pkg}"
action :install
end
end
%w{ WindowsAzureLibsForNet-x64.msi }.each do |pkg|
windows_package "#{pkg}" do
source "https://s3-eu-west-1.amazonaws.com/qainstallerfiles/#{pkg}"
action :install
end
end
%w{ WindowsAzureEmulator-x64.exe }.each do |pkg|
windows_package "#{pkg}" do
source "https://s3-eu-west-1.amazonaws.com/qainstallerfiles/#{pkg}"
options '/quiet /msicl ACCEPTLICENSE=1'
installer_type :custom
action :install
end
end
非常感谢您提供的任何帮助。
【问题讨论】:
-
sqllocaldb二进制文件在您的$Path中吗? -
嗨。是的 sqllocaldb 在路径中。最终。即当我稍后 ssh 并尝试在 powershell 中运行启动命令时,它运行良好。此外,如果我重新运行厨师,那么整个食谱就会成功应用。这就是为什么我想知道时间。 sqllocaldb.msi 是说明书中应用的第一个包,但当我尝试从命令行执行 sqllocaldb 时,几乎好像服务还没有开始
-
第一次运行时 sqllocaldb 是否不在您的路径上?也许它在之后的路径上,但不是在......如果你在
stop-sqllocaldb中提供 sqllocaldb.exe 的完整路径会发生什么?
标签: sql azure express chef-infra