【问题标题】:Azure Worker Role runs on osFamily="2" (Server 2008R2) but Fails on osFamily="3" (Server 2012)Azure Worker Role 在 osFamily="2" (Server 2008R2) 上运行,但在 osFamily="3" (Server 2012) 上失败
【发布时间】:2012-11-25 06:42:36
【问题描述】:

我们有一个 Azure 辅助角色 - .NET 4.0 - 在 osFamily="2" (Server 2008R2) 上部署到 Azure 时运行良好。但是,当我们使用 osFamily="3" (Server 2012) 进行部署并且没有其他代码更改时,worker 角色会不断回收,并在服务器事件日志中出现以下 2 个错误:

错误应用程序名称:WaWorkerHost.exe,版本:6.0.6002.18488,时间戳:0x505cf7ca 错误模块名称:KERNELBASE.dll,版本:6.2.9200.16384,时间戳:0x5010ab2d 异常代码:0xe0434352 故障偏移量:0x00000000000189cc 错误进程ID:0xefc 错误应用程序启动时间:0x01cdd4318f76d221 错误的应用程序路径:E:\base\x64\WaWorkerHost.exe 错误模块路径:D:\Windows\system32\KERNELBASE.dll 报告 ID:cf1810b0-4024-11e2-93ec-00155d4250e3 故障包全名: 错误的包相关应用程序 ID:

应用程序:WaWorkerHost.exe 框架版本:v4.0.30319 说明:进程因未处理的异常而终止。 异常信息:System.InvalidOperationException 堆: 在 Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.b__0() 在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object) 在 System.Threading.ThreadHelper.ThreadStart()

有什么想法吗?

更新 ------------------ 发现第三个异常:

应用程序:WaWorkerHost.exe 框架版本:v4.0.30319 说明:进程因未处理的异常而终止。 异常信息:System.Security.Cryptography.CryptographicException 堆栈:在 Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.b__0() 在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object,布尔值)在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object,布尔值)在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object)在 System.Threading.ThreadHelper.ThreadStart()

我们正在使用 LocalComputer/My 中的证书来解密连接字符串。证书成功部署到 OsFamily="2" (Server 2008R2),并将 Worker 角色用户添加到私钥(在 RDP 会话中验证)。但是,对于 OsFamily="3" (Server 2012) - 未部署证书,因此出现加密错误。跟进 Azure 支持...哎呀。

【问题讨论】:

  • 控制权是否到达您的OnStart()?
  • 您是否尝试在模拟器中调试代码以查找可能引发错误的方法?我假设您使用的是 Azure 1.8 SDK。
  • 是 - 应用程序获取 OnStart 并将 OnStart 记录到 Elmah (SQL)。是的 - 在 Azure 1.8 SDK 上,它在模拟器中运行良好 - 选择任何一个 OSFamily 都不例外。
  • 找到了罪魁祸首 - 错过了第三个异常:
  • 好吧,将OnStart() 中的所有内容包装在一个大的try-catch 中,然后捕获并记录首先抛出的异常。

标签: azure


【解决方案1】:

来自 Azure 支持工程师:

在深入挖掘之后,我发现了不同之处:在 OS Family 2 中, WaWorkerHost 由一个临时帐户(具有 GUID 名称)运行 Role初始化过程生成,此账号有权限 访问证书私钥;在 OS Family 3 中,WaWorkerHost 是 由“NETWORK SERVICE”帐户运行,此帐户没有 私钥访问权限。

我正在联系制作组,我们会调查这个问题 更深。我会及时通知你的。

【讨论】:

  • 是否有针对此问题的受支持修复程序?工人角色/Web 角色无权访问 您 添加的证书的私钥,这很荒谬。这绝对是一个错误!
  • 显然这是一个将在下一个 SDK (?) 中修复的错误,解决方法是将 <Runtime executionContext="elevated" /> 添加到 .csdef 内的 <WorkerRole> 或 @987654325 @节点。 source
猜你喜欢
  • 1970-01-01
  • 2013-11-03
  • 1970-01-01
  • 2019-09-17
  • 2014-01-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-16
相关资源
最近更新 更多