- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
过去一周我一直在尝试解决 Chef COOK-1172没有取得多大成功。我正在尝试使用 Chef-Solo 配置程序通过 Vagrant 安装 SQL Server 2008 R2 Developer Edition(在我的例子中)。
我已经能够通过直接通过 Ruby WinRM gem 在 Chef 之外重现该问题,然后使用自定义 PowerShell 脚本修复该问题,该脚本使用传递的凭据在 guest Windows vagrant 上启动 setup.exe 进程盒子。换句话说,WinRM gem 调用一个远程 PS 脚本,该脚本在指定的凭据下启动 SQL Server setup.exe,并且这有效。
但是,在 guest 上通过 Chef-solo 运行相同的脚本会失败,并出现 InvalidOperationException:无法生成临时类。
我用于测试的 Ruby 脚本和嵌入式 PowerShell 脚本是从我的 OS X 主机调用的:
require 'winrm'
endpoint = 'http://localhost:5985/wsman'
user = password = 'vagrant'
ps = <<EOH
function ps-runas ([String] $cmd, [String] $arguments)
{
Write-Host "ps-runas cmd: $cmd"
Write-Host "ps-runas args: $arguments"
$secpasswd = ConvertTo-SecureString "vagrant" -AsPlainText -Force
$process = New-Object System.Diagnostics.Process
$setup = $process.StartInfo
$setup.FileName = $cmd
$setup.Arguments = $arguments
$setup.UserName = "vagrant"
$setup.Password = $secpasswd
$setup.Verb = "runas"
$setup.UseShellExecute = $false
$setup.RedirectStandardError = $true
$setup.RedirectStandardOutput = $true
$setup.RedirectStandardInput = $false
# Hook into the standard output and error stream events
$errEvent = Register-ObjectEvent -InputObj $process `
-Event "ErrorDataReceived" `
-Action `
{
param
(
[System.Object] $sender,
[System.Diagnostics.DataReceivedEventArgs] $e
)
Write-Host $e.Data
}
$outEvent = Register-ObjectEvent -InputObj $process `
-Event "OutputDataReceived" `
-Action `
{
param
(
[System.Object] $sender,
[System.Diagnostics.DataReceivedEventArgs] $e
)
Write-Host $e.Data
}
Write-Host "ps-runas starting: $cmd"
if (!$process.Start())
{
Write-Error "Failed to start $cmd"
}
$process.BeginOutputReadLine()
$process.BeginErrorReadLine()
# Wait until process exit
$process.WaitForExit()
$process.CancelOutputRead()
$process.CancelErrorRead()
$process.Close()
}
EOH
cmd = ps
# Fails - Running through chef-solo fails - cannot compile a serialization assembly
cmd << "ps-runas \"c:\\opscode\\chef\\bin\\chef-solo.bat\" \"-c c:\\tmp\\vagrant-chef-1\\solo.rb -j c:\\tmp\\vagrant-chef-1\\dna.json\""
# Succeeds - Running setup directly works
#cmd << "ps-runas \"c:\\vagrant\\sql2008r2\\setup.exe\" \"/Q /ConfigurationFile=c:\\vagrant\\ConfigurationFile.ini\""
winrm = WinRM::WinRMWebService.new(endpoint, :plaintext, :user => user, :pass => password, :basic_auth_only => true)
winrm.set_timeout(60*20)
winrm.powershell(cmd) do |stdout, stderr|
STDOUT.print stdout
STDERR.print stderr
end
puts 'Done!'
来自sql安装日志:
013-03-03 22:44:50 Slp: Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
2013-03-03 22:44:50 Slp: Message:
2013-03-03 22:44:50 Slp: Unable to generate a temporary class (result=1).
2013-03-03 22:44:50 Slp: error CS0583: Internal Compiler Error (0xc0000017 at address 000007FEFD00AA7D): likely culprit is 'IMPORT'.
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'IMPORT' symbol 'System.Xml.Serialization.XmlSerializationReader'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'IMPORT' symbol 'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderClusterNodesStatusPublicConfigObject'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderClusterNodesStatusPublicConfigObject'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml.Serialization.GeneratedAssembly'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml.Serialization'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol '<global namespace>'
2013-03-03 22:44:50 Slp: error CS0586: Internal Compiler Error: stage 'PREPARE'
2013-03-03 22:44:50 Slp: error CS0587: Internal Compiler Error: stage 'PREPARE'
2013-03-03 22:44:50 Slp: error CS0587: Internal Compiler Error: stage 'BEGIN'
2013-03-03 22:44:50 Slp:
2013-03-03 22:44:50 Slp: Stack:
2013-03-03 22:44:50 Slp: at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.DeserializeObject(String rootPath, Type type, String elementXPath)
2013-03-03 22:44:50 Slp: at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.DeserializeObject(String rootPath, Type type)
2013-03-03 22:44:50 Slp: at Microsoft.SqlServer.Configuration.SetupExtension.FinalCalculateSettingsAction.ExecuteAction(String actionId)
2013-03-03 22:44:50 Slp: at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
2013-03-03 22:44:50 Slp: at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun)
2013-03-03 22:44:50 Slp: Inner exception type: System.InvalidOperationException
2013-03-03 22:44:50 Slp: Message:
2013-03-03 22:44:50 Slp: Unable to generate a temporary class (result=1).
2013-03-03 22:44:50 Slp: error CS0583: Internal Compiler Error (0xc0000017 at address 000007FEFD00AA7D): likely culprit is 'IMPORT'.
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'IMPORT' symbol 'System.Xml.Serialization.XmlSerializationReader'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'IMPORT' symbol 'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderClusterNodesStatusPublicConfigObject'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderClusterNodesStatusPublicConfigObject'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml.Serialization.GeneratedAssembly'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml.Serialization'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft.Xml'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol 'Microsoft'
2013-03-03 22:44:50 Slp: error CS0584: Internal Compiler Error: stage 'PREPARE' symbol '<global namespace>'
2013-03-03 22:44:50 Slp: error CS0586: Internal Compiler Error: stage 'PREPARE'
2013-03-03 22:44:50 Slp: error CS0587: Internal Compiler Error: stage 'PREPARE'
2013-03-03 22:44:50 Slp: error CS0587: Internal Compiler Error: stage 'BEGIN'
2013-03-03 22:44:50 Slp:
2013-03-03 22:44:50 Slp: Stack:
2013-03-03 22:44:50 Slp: at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
2013-03-03 22:44:50 Slp: at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
2013-03-03 22:44:50 Slp: at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
2013-03-03 22:44:50 Slp: at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
2013-03-03 22:44:50 Slp: at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
2013-03-03 22:44:50 Slp: at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.DeserializeObject(String rootPath, Type type, String elementXPath)
我的第一个怀疑是我的临时目录遇到了某种权限问题,但我尝试运行 ProcMon,但在运行安装程序时没有发现任何“访问被拒绝”结果。此外,由于 PowerShell 脚本和 UAC 已关闭,我明确以本地管理员 (vagrant) 身份运行。
最佳答案
我可能会列出我所做的很多事情来追踪这个问题,但最终我发现失败并不是特定于通过 Chef 甚至 Ruby 运行安装程序。本质上,每当我使用另一个进程通过 WinRM 安装 SQL Server 时,甚至 PowerShell 都会出错,这会在安装程序日志中产生 OutOfMemoryException。
这最终让我想知道通过 WinRM 执行安装程序有什么不同。然后我有了一个想法。如果我是 Microsoft,我可能会在 WinRM 周围提供一些企业功能,以限制服务器上的攻击面。显然WinRM有一个名为Quota Management的功能.
简而言之,修改 Windows guest 虚拟机的本地组策略解决了问题,我终于能够通过 WinRM 和 Chef(使用上面的 PS 脚本)成功安装 SQL Server。以下是我使用的设置:
Console Root | Local Computer Policy | Computer Configuration | Administrative Templates | Windows Components | Windows Remote Shell
- MaxConcurrentUsers: 100
- MaxMemoryPerShellMB: 0
- MaxProcessesPerShell: 0
- MaxShellsPerUser: 0
关于sql-server - 在 vagrant 上通过 Chef-solo 时,SQL Server 安装失败,错误代码为 "Unable to generate a temporary class",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15206545/
我的打包代码包含打包厨师 solo 供应商 { "type": "chef-solo", "cookbook_paths": ["chef/cookbooks/vendor"], "run
我理解 chef-client --daemonize 的目的,因为它是 Chef Server 可以连接和交互的服务。 但 chef-solo 是一个简单地使当前系统符合规范然后完成的命令。 那么
我正在尝试断言文本“abcd:移至历史记录”。所以我的代码是这样的: assertTrue("消息未显示",solo.searchText("abcd : 移至历史记录")); 虽然屏幕上显示消息“a
我创建了测试项目。在那里我创建了文件夹“robotium”并粘贴了 2 个 robotium jar 文件(robotium-solo-3.4.1-javadoc.jar 和 robtium-solo
在 Redhat/Fedora 上安装 Chef-solo 的正确方法是什么? 我尝试按照 opscode wiki 上的说明进行操作,但运行后 gem install chef --no-ri --
当我运行引导命令时,它会多次询问密码 Running Chef on 123.123.123.123... Installing Librarian cookbooks... Uploading th
我在我的 robotium 测试用例中使用 solo.searchText 函数。我将文本作为“$ testdata”传递以进行搜索。但即使屏幕上有文字,它也不会检测到文字。在使用 solo.sear
chef-solo 在安装 redis 时卡在最后,就好像 chef 在等待某个事件发生一样。这是我不得不用 ctrl+c 杀死它时的输出。 [2013-05-14T15:55:27+00:00] 错
我有一个测试类,但总是在 tearDown() 中得到一个 NullPointerException,有人知道为什么吗? public class LaunchManagerActivityTest
我不知道为什么我在互联网上找不到任何关于这个的信息。 我基本上想编写一个提示用户输入他们的 github 用户名/密码的 Recipe ,然后发布到 github API 以添加一个 ssh key
我已经为此苦苦挣扎了几个小时,但似乎没有取得任何进展。关于我应该从哪里开始调试的任何提示将不胜感激。 我正在尝试配置一个 Vagrant 机器并收到以下错误。 `==> default: Runnin
当使用 Vagrant 和厨师作为供应者时,我得到以下警告: [web] Chef 11.12.2 Omnibus package is already installed. [web] Runnin
我有一个似乎与此类似的问题:Berkshelf cookbooks are not being copied to the Vagrant directory , 但我相信它是不同的。 当我运行一个
我已经设置了一个基本的 Chef 基础架构,其中包含一个工作站、一个托管的 Chef 服务器和一个用作节点的 Ubuntu 服务器。我在我的工作场所使用此设置,因此需要代理才能连接互联网。我已经在 k
我正在使用 Chef-solo,以避免管理多个实例的麻烦(如果您认为这不是一个好主意,请纠正我) 我定义了一个“数据库”角色;我在目标节点上使用 Chef-solo 进行 cooking 。 现在,我
我正在使用 robotium 来测试我的应用程序。问题出在 solo.searchText 函数上。在我的应用程序中,我使用 expandale listview 来显示类别值。在使用 robotiu
我正在使用 robotium 来测试一个 android 项目。我有一个测试用例,我需要在其中测试一条由特殊字符组成的消息是否正确发布。所以我创建了一个由特殊字符组成的常量: public stati
我已经在 Redhat Linux 7.2 中安装了 ChefDK rpm 包。 chef-solo --version 命令提供了正确的版本(Chef:12.19.36)。 现在我尝试使用以下 ch
在我的 Activity 中,我执行 startActivityForResult(MediaStore.ACTION_IMAGE_CAPTURE), 然后我进入内置相机 Activity (在本例中
我从 Chef 社区下载了食谱“oc-java-master”,现在我尝试使用我安装在 Windows Server 2008 上的 Chef-solo 来运行它。 经过大量的谷歌搜索和 stacko
我是一名优秀的程序员,十分优秀!