4

我使用 Chef 插件在 Azure 中设置了一个新的 Win2012 VM,并将其连接到 manage.chef.io。添加了一个使用 WebPi 说明书来安装 ServiceBus 及其依赖项的说明书。安装失败并出现以下错误:

“Error opening installation log file. Verify that the specified log file location exists and is writable.”

经过一番搜索,根据这篇 2013 年的博客文章,这在 Azure 中似乎并不新鲜 - https://nemetht.wordpress.com/2013/02/27/web-platform-installer-in-windows-azure-startup-tasks /

它提供了一种暂时禁用文件夹安全性的技巧,但我正在寻找更好的解决方案。

有任何想法吗?

更多的日志输出 -

Started installing: 'Microsoft Windows Fabric V1 RTM'

 .  

Install completed (Failure): 'Microsoft Windows Fabric V1 RTM'

 .  

WindowsFabric_1_0_960_0 : Failed.
Error opening installation log file. Verify that the specified log file location exists and is writable.


DependencyFailed: Microsoft Windows Fabric V1 CU1


DependencyFailed: Windows Azure Pack: Service Bus 1.1

 .  
 .. 




Verifying successful installation...


Microsoft Visual C++ 2012 SP1 Redistributable Package (x64) True


Microsoft Windows Fabric V1 RTM                    False


    Log Location: C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Web Platform Installer\logs\install\2015-05-11T14.15.51\WindowsFabric.txt


Microsoft Windows Fabric V1 CU1                    False


Windows Azure Pack: Service Bus 1.1                False


Install of Products: FAILURE
STDERR: 
---- End output of "WebpiCmd.exe" /Install /products:ServiceBus_1_1 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log ----
Ran "WebpiCmd.exe" /Install /products:ServiceBus_1_1 /suppressreboot /accepteula /Log:c:/chef/cache/WebPI.log returned -1
4

2 回答 2

5

一位厨师联系人(感谢 Bryan!)帮助我更好地理解了这个问题。一些 WebPI 包不遵守提供给 WebPIcmd.exe 的显式日志路径。作者应该修复包以在设置时使用提供的日志路径。所以选项变成了:

  • 让作者修复包
  • 以有权访问 AppData 文件夹的其他用户身份在新的计划任务中运行 Chef
  • 编辑说明书以执行/取消执行注册表编辑以临时将 AppData 文件夹移动到系统用户有权访问的位置。在我的自定义食谱中或 fork WebPI 食谱中。

显然,等待作者(在本例中为 Microsoft)修复软件包不会很快发生。

考虑到整个想法是在预配时提供配置并且它可以正常工作,因此更改 Azure VM 运行 Chef 的方式没有意义。另外,更改默认设置可能会产生意想不到的后果,并使我们处于非标准环境中。

在短期内,我决定更改我的自定义食谱中的注册表。

registry_key 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' do
    values [{
        :name => "Local AppData",
        :type => :expand_string,
        :data => "%~dp0appdata"
        }]
        action :create
end
webpi_product 'ServiceBus_1_1' do
    accept_eula true
    action :install
end
webpi_product 'ServiceBus_1_1_CU1' do
    accept_eula true
    action :install
end
registry_key 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' do
    values [{
        :name => "Local AppData",
        :type => :expand_string,
        :data => '%%USERPROFILE%%\AppData\Local'
        }]
end

此更改也可以在 WebPI 食谱中完成,以解决所有相关食谱的此问题。我决定在 WebPI 团队响应框架的功能请求以验证包是否尊重日志路径之前不处理此问题。

http://forums.iis.net/t/1225061.aspx?WebPI+Feature+Request+Validate+product+package+log+path+usage

请回复此线程以尝试让团队帮助防止此常见包问题。

于 2015-05-18T14:40:54.860 回答
0

这是POWERSHELL的解决方案

在创建 VMSS VM 期间安装“Service Fabric SDK”时遇到了同样的错误。还使用了系统用户。

问题:当我用我的“管理员”用户连接 RDP 并运行它时,它起作用了。

解决方法:如上更改注册表项,安装并重置回来

这是我使用“powershell”的解决方案

我将 2 个 .reg 文件安装到 %TEMP% 文件夹中。内容是新旧导出的键/值

  • 插件-sf-SDK-temp.reg
Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Local AppData"=hex(2):25,00,54,00,45,00,4d,00,50,00,25,00,00,00
  • 插件-sf-SDK-orig.reg
Windows Registry Editor Version 5.00

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Local AppData"=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,\
  49,00,4c,00,45,00,25,00,5c,00,41,00,70,00,70,00,44,00,61,00,74,00,61,00,5c,\
  00,4c,00,6f,00,63,00,61,00,6c,00,00,00

将以下代码集成到您的 custom-powershelgl 脚本中:

Write-Output "Reset LocalApp Folder to TEMP"
Start-Process "$($env:windir)\regedit.exe" `
   -ArgumentList "/s", "$($env:TEMP)\plugin-sf-SDK-temp.reg"


## replace the following lines with your installation - here my SF SDK installation via WebWPIcmd
Write-Output "Installing /Products:MicrosoftAzure-ServiceFabric-CoreSDK"
Start-Process "$($env:programfiles)\microsoft\web platform installer\WebPICMD.exe" `
    -ArgumentList '/Install', `
       '/Products:"MicrosoftAzure-ServiceFabric-CoreSDK"', `
       '/AcceptEULA', "/Log:$($env:TEMP)\WebPICMD-install-service-fabric-sdk.log" `
    -NoNewWindow -Wait `
    -RedirectStandardOutput "$($env:TEMP)\WebPICMD.log" `
    -RedirectStandardError "$($env:TEMP)\WebPICMD.error.log" 


Write-Output "Reset LocalApp Folder to ORIG"
Start-Process "$($env:windir)\regedit.exe" `
   -ArgumentList "/s", "$($env:TEMP)\plugin-sf-SDK-orig.reg"
于 2021-06-03T09:04:59.113 回答