为什么我们在 SSRS 2008 中得到 "An unexpected error occurred in Report Processing"?

Why do we get "An unexpected error occurred in Report Processing" in SSRS 2008?

我们经常在 SSRS 日志文件中看到这种错误。这似乎是 SSRS 引擎内部发生的内部错误。我们如何调试它?当报告失败时,我们没有得到任何其他相关信息。

library!ReportServer_0-1!2864!09/09/2016-00:28:15:: w WARN: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.Threading.ThreadAbortException: Thread was being aborted. at Microsoft.Win32.Win32Native.SetFilePointerWin32(SafeFileHandle handle, Int32 lo, Int32* hi, Int32 origin) at Microsoft.Win32.Win32Native.SetFilePointer(SafeFileHandle handle, Int64 offset, SeekOrigin origin, Int32& hr) at System.IO.FileStream.SeekCore(Int64 offset, SeekOrigin origin) at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin) at Microsoft.ReportingServices.Library.PartitionFileStream.Seek(Int64 offset, SeekOrigin origin) at Microsoft.ReportingServices.Library.MemoryUntilThresholdStream.Seek(Int64 offset, SeekOrigin origin) at Microsoft.ReportingServices.Library.RSStream.Seek(Int64 offset, SeekOrigin origin) at System.IO.BufferedStream.Seek(Int64 offset, SeekOrigin origin) at Microsoft.ReportingServices.Rendering.RPLProcessing.RPLReader.ReadElementProps(Int64 startOffset, RPLContext context, Byte& elementType) at Microsoft.ReportingServices.Rendering.ExcelRenderer.Layout.LayoutEngine.RenderNewItem(IRowItemStruct item, Int32 top, Int32 topRow, IExcelGenerator excel, String pageContentKey, Dictionary2 sharedBorderCache, Dictionary2 sharedImageCache, Boolean& autosizableGrow, Boolean& autosizableShrink) at Microsoft.ReportingServices.Rendering.ExcelRenderer.Layout.LayoutEngine.RenderPageToExcel(IExcelGenerator excel, String key, Dictionary2 sharedBorderCache, Dictionary2 sharedImageCache) at Microsoft.ReportingServices.Rendering.ExcelRenderer.MainEngine.RenderRPLPage(RPLReport report, Boolean headerInBody, Boolean suppressOutlines) at Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream) at Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.InvokeRenderer(IRenderingExtension renderer, Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream) at Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.Execute(IRenderingExtension newRenderer) --- End of inner exception stack trace --- at Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.Execute(IRenderingExtension newRenderer) at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(DateTime executionTimeStamp, ProcessingContext pc, RenderingContext rc, IChunkFactory yukonCompiledDefinition) at Microsoft.ReportingServices.Library.RenderLive.CallProcessingAndRendering(ProcessingContext pc, RenderingContext rc, OnDemandProcessingResult& result) at Microsoft.ReportingService webserver!ReportServer_0-1!2864!09/09/2016-00:28:16:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.UnhandledHttpApplicationException: , Microsoft.ReportingServices.Diagnostics.Utilities.UnhandledHttpApplicationException: The report server encountered an unhandled exception in HttpApplication. ---> System.Web.HttpException: Request timed out.
--- End of inner exception stack trace ---;

---------更新---------

我在日志中看到新的错误

library!WindowsService_0!e88!09/09/2016-17:09:45:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerStorageException: , An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database.; dbcleanup!WindowsService_0!e88!09/09/2016-17:09:45:: e ERROR: Error in CleanOrphanedSnapshots: Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerStorageException: An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. library!WindowsService_0!e88!09/09/2016-17:09:45:: i INFO: Cleaned 0 batch records, 0 policies, 0 sessions, 0 cache entries, 0 snapshots, 0 chunks, 4 running jobs, 0 persisted streams, 0 segments, 0 segment mappings, 0 edit sessions.

---------更新---------

将所有超时更新为 12 小时并将 DO NOT TIMEOUT 设置更新到 SSRS 站点设置后,我们现在看到差异错误。

到目前为止我们已经检查了执行日志,没有显示错误。在 ssrs 日志文件中发现以下错误。服务器有 32GB 内存,我们 运行 64 位 OS。该报告有时生成良好,大小为 200MB。

httpruntime!ReportServer_0-2!58dc!09/12/2016-23:26:45:: e ERROR: Failed in BaseWorkerRequest::SendHttpResponse(bool), exception=System.Runtime.InteropServices.COMException (0x800703E3): The I/O operation has been aborted because of either a thread exit or an application request. (Exception from HRESULT: 0x800703E3) at Microsoft.ReportingServices.HostingInterfaces.IRsHttpPipeline.SendResponse(Void* response, Boolean finalWrite, Boolean closeConn) at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush) library!ReportServer_0-2!58dc!09/12/2016-23:26:45:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: RsWorkerRequest::FlushResponse., Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: An internal or system error occurred in the HTTP Runtime object for application domain ReportServer_REPCENTER_0-2-131182052998828671. ---> System.Runtime.InteropServices.COMException (0x800703E3): The I/O operation has been aborted because of either a thread exit or an application request. (Exception from HRESULT: 0x800703E3) at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush) at ReportingServicesHttpRuntime.RsWorkerRequest.FlushResponse(Boolean finalFlush) --- End of inner exception stack trace ---;

终于有了答案。它是 "rsreportserver.config" 文件中的 recyletime 元素。默认情况下,此元素值设置为 720 分钟(12 小时)。这意味着从您启动 SSRS 服务开始,它将每 12 小时回收一次。我们的服务是在午夜发布期间开始的,这意味着它每天中午都在回收。我们已将此值更新为 24 小时。

    <RecycleTime>1440</RecycleTime>
    <MaxAppDomainUnloadTime>60</MaxAppDomainUnloadTime>