You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

报表服务数据驱动订阅随机终止:无法读取DataSet1数据集下一行数据

问题描述

我们在一台服务器上运行Microsoft SQL Server 2008 R2,ReportServer数据库存储于此;Reporting Services与另一台服务器上的SharePoint服务集成。近年来两台服务器负载日益增加。

我们有一个数据驱动订阅,会按发票号生成月度发票,每次运行通常生成30至40张。近几个月发现部分发票(3至6张)生成失败,日志显示:

Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the dataset DataSet1

由于每张发票都通过DataSet1上的同一存储过程生成,但并非全部失败,因此我认为错误并非源于存储过程本身。想请教解决该问题的方向,感谢!

SSRS跟踪日志示例

processing!WindowsService_1!59c58!04/08/2024-18:40:18:: e ERROR: An exception has occurred in data set 'DataSet1'. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the dataset DataSet1. ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. Operation cancelled by user.
processing!WindowsService_1!59c58!04/08/2024-18:40:18:: i INFO: DataPrefetch abort handler called for Report with ID=. Aborting data sources ...
processing!WindowsService_1!59c58!04/08/2024-18:40:18:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: , Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the dataset DataSet1. ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. Operation cancelled by user. --- End of inner exception stack trace ---;
processing!WindowsService_1!59c58!04/08/2024-18:40:18:: w WARN: Data source 'BIDW': Report processing has been aborted.
processing!WindowsService_1!59c58!04/08/2024-18:40:18:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: , Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the dataset DataSet1. ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. Operation cancelled by user. --- End of inner exception stack trace ---;
library!WindowsService_1!59c58!04/08/2024-18:40:18:: w WARN: Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the dataset DataSet1. ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. Operation cancelled by user.
library!WindowsService_1!59c58!04/08/2024-18:40:18:: i INFO: Initializing EnableExecutionLogging to 'True' as specified in Server system properties.
subscription!WindowsService_1!59c58!04/08/2024-18:40:18:: i INFO: Failure writing file : Microsoft.ReportingServices.Diagnostics.Utilities.RSException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the dataset DataSet1. ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. Operation cancelled by user..
subscription!WindowsService_1!59c58!04/08/2024-18:40:18:: i INFO: Error writing file ha001_202403016 to path http://www.example.com/bi/Reports/SIP/Sales/Report Output/HA 001
notification!WindowsService_1!59c58!04/08/2024-18:40:18:: e ERROR: Error occured processing subscription 2b3660a2-e604-4b71-99cc-74d2a11408f7: Failure writing file : An error has occurred during report processing..
processing!WindowsService_1!59b58!04/08/2024-18:40:18:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the dataset DataSet1. ---> System.Data.SqlClient.SqlException: A severe error occurred on the current command. The results, if any, should be discarded. Operation cancelled by user. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

排查方向
  • 检查服务器资源瓶颈:结合日志里的Operation cancelled by user和服务器负载增加的背景,优先排查SQL Server或SSRS服务器的CPU、内存、磁盘IO是否在发票生成时段耗尽。可以监控SQL Server的等待类型(如PAGEIOLATCH_*、CXPACKET)、CPU使用率、内存占用,以及SSRS服务器的资源使用情况。
  • 调整订阅并发设置:SSRS数据驱动订阅默认会并发处理多个报表实例,过高的并发会导致数据库请求过载。可以修改SSRS配置文件中的MaxQueueThreads、MaxActiveReqForOneUser等参数,降低并发处理数量,避免同时压垮数据库。
  • 优化存储过程与超时配置:虽然大部分发票生成成功,但部分失败可能是特定发票数据量更大、查询更复杂导致超时。检查存储过程的执行计划,确认是否存在缺失索引、统计信息过时的问题;同时调整SSRS数据集的超时设置,以及SQL Server的远程查询超时配置。
  • 排查网络稳定性:SSRS与SQL Server之间的网络波动可能导致连接中断,引发此类错误。检查两台服务器之间的网络延迟、丢包率,查看Windows事件日志中的网络相关错误。
  • 查看SQL Server错误日志:日志中提到的A severe error occurred on the current command,在SQL Server的错误日志里会有更详细的错误号、内部细节,有助于定位是数据库引擎问题还是资源限制导致的命令终止。

内容的提问来源于stack exchange,提问作者HandsomePig

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 02:24:57