s-s-rS 2005 API 导致应用程序池崩溃

Posted

技术标签:

【中文标题】s-s-rS 2005 API 导致应用程序池崩溃【英文标题】:s-s-rS 2005 API Causing Application Pool Crash 【发布时间】:2011-05-05 20:30:02 【问题描述】:

我的网站开始出现应用程序池在使用 Reporting Services 管理器时崩溃的问题。这发生在不止一个安装中。我已将 Reports 和 ReportServer 网站分离到它们自己的应用程序池中以找出问题并将问题本地化到 ReportServer,因为它是唯一崩溃的应用程序池。

这始于我们实施 ReportingServices2005 API 的时候。下面附上一个示例调用,我们使用它来检索 s-s-rS 文件夹中的报告列表。

目前,我们的应用程序使用 javascript (Jquery) 对 C# .NET 函数进行 ajax 调用,该函数会调用 s-s-rS API。

这似乎是随机发生的,因为应用程序池不会在几天内崩溃或在重启后数小时内崩溃。一旦发生此错误,应用程序池将拒绝所有未来的连接,但是 IIS UI 不会显示应用程序池已停止。 httperr 日志显示应用程序池由于快速故障保护而被禁用。关闭快速故障保护后,仍然会发生崩溃,并且应用程序池会断开所有连接。

我们查看了来自应用程序池和报告服务的所有日志。我们还向 IIS 添加了调试诊断工具,以从服务器检索转储文件。没有什么明显的事情发生在我们身上,我们现在不知所措。

Reporting Services API 调用示例:

    [WebMethod(EnableSession = false)]
    [ScriptMethod]
    public List<CatalogItem> GetReportList()
    
        CatalogItem[] items = null;
        List<CatalogItem> ret = new List<CatalogItem>();
        try
        
            ReportingService2005 rs = new ReportingService2005();
            rs.Url = ConfigurationManager.AppSettings["Reporting_Services_Url"];
            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

            // Use the reports path in the app config 
            string path = ConfigurationManager.AppSettings["ReportServer_ReportList_Path"];

            if (path == null || path == "") path = "/"; // send in at least a base root "/"
            items = rs.ListChildren(path, true);

            foreach (CatalogItem item in items)
            
                if (item.Type == ItemTypeEnum.Folder || item.Type == ItemTypeEnum.Report)
                
                    if (item.Name != "Search Reports" && item.Name != "My Reports" && item.Name != "Users Folders" && item.Name != "Data Sources")
                        ret.Add(item);
                
            
        
        catch (System.Exception ex)
        
            Guid? guid = ExceptionPolicy.HandledException(ex);
            // json object to include the guid as well as the exception info, for UI retrieval
            string jsonErrData = AjaxErrorHandling.CreateJsonFormat(guid, ex.Message, ex.GetType().ToString());
            throw new Exception(jsonErrData);
        
        return ret;
    

转储日志警告:

Crash_Rule_Targets_Date_11_03_2010__Time_09_16_14AM_w3wp.exe_ReportServer_PID_5256_371_Manual Dump.dmp 中的以下线程是等待通过 WinSock 从另一台服务器返回的数据 对 WinSock 的调用源自 0x02a6a1c3,目标地址为 IP 地址 127.0.0.1 的 80 端口

( 62 )1.12% 的线程被阻塞

确保此应用程序可能调用的任何远程服务器都运行正常,并且两台服务器之间没有网络问题。如果问题仍然存在,请联系应用程序供应商以获得进一步帮助

转储线程有问题

线程 62 - 系统 ID 3024 入口点 mscorwks!Thread::intermediateThreadProc 创建时间 11/2/2010 7:21:00 PM 在用户模式下花费的时间 0 天 00:00:00.734 在内核模式下花费的时间 0 Days 00:00:00.156

此线程正在等待通过 WinSock 从另一台服务器返回的数据。

对 WinSock 的调用源自 0x02a6a1c3,目标地址为 IP 地址 127.0.0.1 的 80 端口

线程 62 操作系统线程 ID 上的 WinDbg 转储访问:0xbd0 (62) ESP EIP 2b13edb0 7c82860c [NDirectMethodFrameStandalone: 2b13edb0] System.Net.UnsafeNclNativeMethods+OSSOCK.recv(IntPtr, Byte*, Int32, System.Net.Sockets.SocketFlags) 2b13edc8 7a581b04 System.Net.Sockets.Socket.Receive(字节 [],Int32,Int32, System.Net.Sockets.SocketFlags,System.Net.Sockets.SocketError ByRef) 2b13ee00 7a581a00 System.Net.Sockets.Socket.Receive(字节 [],Int32, Int32, System.Net.Sockets.SocketFlags) 2b13ee20 7a58b854 System.Net.Sockets.NetworkStream.Read(Byte[], Int32, Int32) 2b13ee50 7a58b7bb System.Net.PooledStream.Read(字节[],Int32,Int32)2b13ee6c 7a58b4aa System.Net.Connection.SyncRead(System.Net.HttpWebRequest, 布尔值,布尔值)2b13eec0 7a58b30a System.Net.Connection.PollAndRead(System.Net.HttpWebRequest,布尔值) 2b13eed8 7a58b29b System.Net.ConnectStream.PollAndRead(布尔值) 2b13eee4 7a58b132 System.Net.HttpWebRequest.EndWriteHeaders(布尔值) 2b13ef10 7a58b056 System.Net.HttpWebRequest.WriteHeadersCallback(System.Net.WebExceptionStatus, System.Net.ConnectStream,布尔值)2b13ef24 7a58ac11 System.Net.ConnectStream.WriteHeaders(布尔)2b13ef78 7a588f82 System.Net.HttpWebRequest.EndSubmitRequest() 2b13efa4 7a588e9f System.Net.HttpWebRequest.SetRequestSubmitDone(System.Net.ConnectStream) 2b13efb8 7a5888c2 System.Net.Connection.CompleteStartRequest(布尔值, System.Net.HttpWebRequest、System.Net.TriState) 2b13efe8 7a588233 System.Net.Connection.SubmitRequest(System.Net.HttpWebRequest) 2b13f02c 7a587bac System.Net.ServicePoint.SubmitRequest(System.Net.HttpWebRequest, System.String) 2b13f064 7a587479 System.Net.HttpWebRequest.SubmitRequest(System.Net.ServicePoint) 2b13f090 7aaaa4d4 System.Net.HttpWebRequest.GetResponse() 2b13f0d0 65dda7e5 System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(System.Net.WebRequest) 2b13f100 65dde895 System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(System.Net.WebRequest) 2b13f104 2f51e76e Microsoft.ReportingServices.UI.Global+RSWebServiceWrapper.GetWebResponse(System.Net.WebRequest) 2b13f114 65e09905 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(System.String, System.Object[]) 2b13f158 2be6bd5c Microsoft.SqlServer.ReportingServices2005.ReportingService2005.ListSecureMethods() 2b13f164 2f51df12 Microsoft.SqlServer.ReportingServices2005.RSConnection.GetSecureMethods() 2b13f19c 2f51de3a Microsoft.ReportingServices.UI.Global+RSWebServiceWrapper.GetSecureMethods() 2b13f1c4 2f51dd9b Microsoft.SqlServer.ReportingServices2005.RSConnection.IsSecureMethod(System.String) 2b13f1dc 2f51dd13 Microsoft.SqlServer.ReportingServices2005.RSConnection.ValidateConnection() 2b13f204 2f5197d2 Microsoft.ReportingServices.UI.Global.SecureAllAPI() 2b13f20c 2f519720 Microsoft.ReportingServices.UI.ReportingPage.EnsureHttpsLevel(Microsoft.ReportingServices.Diagnostics.HttpsLevel) 2b13f218 2f5191e4 Microsoft.ReportingServices.UI.ReportingPage.ReportingPage_Init(System.Object, System.EventArgs) 2b13f260 02a6b30d [多播帧:2b13f260] System.EventHandler.Invoke(System.Object, System.EventArgs) 2b13f274 660ab484 System.Web.UI.Control.OnInit(System.EventArgs)2b13f288 660a72ed System.Web.UI.Page.OnInit(System.EventArgs) 2b13f294 660ab5de System.Web.UI.Control.InitRecursive(System.Web.UI.Control) 2b13f2b4 660a7a3b System.Web.UI.Page.ProcessRequestMain(布尔,布尔) 2b13f40c 660a7764 System.Web.UI.Page.ProcessRequest(布尔值,布尔值) 2b13f444 660a7691 System.Web.UI.Page.ProcessRequest() 2b13f47c 660a7626 System.Web.UI.Page.ProcessRequestWithNoAssert(System.Web.HttpContext) 2b13f488 660a7602 System.Web.UI.Page.ProcessRequest(System.Web.HttpContext) 2b13f49c 2f519105 ASP.pages_report_aspx.ProcessRequest(System.Web.HttpContext) 2b13f4a0 660adad6 System.Web.HttpApplication+CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 2b13f4d4 6608132c System.Web.HttpApplication.ExecuteStep(IExecutionStep,布尔 ByRef) 2b13f514 6608c5c3 System.Web.HttpApplication+ApplicationStepManager.ResumeSteps(System.Exception) 2b13f564 660808ac System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(System.Web.HttpContext, System.AsyncCallback, System.Object) 2b13f580 66083e1c System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest) 2b13f5b4 66083ac3 System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest) 2b13f5c4 66082c5c System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr,Int32)2b13f7d8 79f9811e [ContextTransitionFrame: 2b13f7d8] 2b13f80c 79f9811e [GCFrame: 2b13f80c] 2b13f968 79f9811e [ComMethodFrame: 2b13f968]

【问题讨论】:

【参考方案1】:

检查您的数据库服务器运行状况、监控 ReportServer 数据库和您的应用程序数据库。运行分析器以捕获死锁、锁定、事务超时等。

暂时禁用s-s-rS缓存,看看这个错误是否再次发生。

【讨论】:

如果服务器根本没有负载,就会发生在多个客户端上。运行报告的存储过程很复杂,但返回结果速度足够快,而且没有故障排除我眼中的数据库服务器健康状况。 我不确定我是否遵循 s-s-rS 缓存。我们已将其设置为一次只保留一份报告的快照。但不确定删除缓存的另一个设置。您是否还认为数据库中的死锁或事务超时会导致应用程序池崩溃,而不仅仅是报告服务中的警告。【参考方案2】:

事件日志中有任何与 WAS 相关的内容吗?

【讨论】:

事件日志中的任何内容都与 WAS 无关。

以上是关于s-s-rS 2005 API 导致应用程序池崩溃的主要内容,如果未能解决你的问题,请参考以下文章

s-s-rS 2005,钻取中的“未指定某些参数或凭据”

s-s-rS 报告需要在 s-s-rS 2008 (VS 2008) 中重用来自 s-s-rS 2005 (VS 2005) 的 rdl 文件

s-s-rS 2005 矩阵报告 - 编辑总计

2005 年至 2008 年 s-s-rS 字体粗细

在 s-s-rS 2008 中呈现 s-s-rS 2005 报告(如 .pdf)时,整个表被推送到下一页

IIS 6.0 应用程序池崩溃