【发布时间】: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