2
votes

I have an application which stores photo data in database. An SSRS report is used to generate reports of photos related to a specific entity. The information required to generate this report is stored in a separate database and very simply links a ReportId with a number of photos. The Reporting Services Execution Web service is used to render a report in Word format and output a byte array which is then used by the application.

The issue is, there is a very clear and repeatable size limit beyond which the report is not received by the application. In each case the report is rendered successfully but the response is never sent as per the RS logs:

rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x0057, pipeline=0x0000027542592740.
httpruntime!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Failed in 
BaseWorkerRequest::SendHttpResponse(bool), exception=System.ArgumentException: Value does not fall within the expected range.
   at Microsoft.ReportingServices.HostingInterfaces.IRsHttpPipeline.SendResponse(Void* response, Boolean finalWrite, Boolean closeConn)
   at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
library!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: 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_SSRS_0-1-131655000672564770. ---> System.ArgumentException: Value does not fall within the expected range.
   at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
   at ReportingServicesHttpRuntime.RsWorkerRequest.FlushResponse(Boolean finalFlush)
   --- End of inner exception stack trace ---;
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x10DD, pipeline=0x0000027542592740.

This appears to be directly related to some size limit of the service http response for the following reasons:

  • The request itself is very small, just a Report Id i.e. httpRuntime maxRequestLength is not related, this has been tested.
  • The error happens within a few minutes of the request i.e. httpRuntime executionTimeout is not related, this has been tested.
  • I can reliably and repeatably add one photo too many to the report and it will fail, remove one photo and it renders and sends with no issues, add one photo and it will fail...
  • The times to render vary so again it appears more related to size than some timeout.
  • The report server execution logs show that the rendering is successful every time, regardless of whether the report is sent or not.
  • I have reproduced the error using both the application which normally calls the report and a separate console app that simply generates a web service client and tries to render and receive the report as a byte array using the Render2 method.
  • I have reproduced this error using SQL Server 2012 and SQL Server 2016, on several different report servers, including setting up a report server locally and running the server and request on the same machine.
  • Regardless of the combination of photos, the report always renders successfully but fails to send around a bytecount of ~238,000,000 i.e. not related to some bad data.
  • In all cases I am able to generate reports of the same size or greater through the Report Server portal with no issues.

Has anyone experienced similar behaviour using the RS web service? I have searched online extensively without any luck. Any suggestions on how to address this issue would be greatly appreciated.

1
It is related, it's my question.Dave
Just thinking out loud here but those images are probally embedded into the document. What if you streamed them to a temporary remote location that the user was authorized to access and link them in the document. First, I cant say off the top of my head how you instruct the renderer to link vs embed and secondly, I don't know if that would be feasible for your clients if you could get it to work.Ross Bush
I have seen many, many ssrs logs over the years and have not come across this. Actually, this is the first time I have seen a raw C++ error dump. I guess that means it is bad and will be like finding a needle in a haystack, however, nothing is impossible to solve. Have you seen the responses about SharePoint, linked servers and drivers? Also, it may be worthwhile opening a connect ticket with Microsoft.Ross Bush
One other facet to explore perhaps --> support.microsoft.com/en-us/help/211489/…Ross Bush

1 Answers

0
votes

Microsoft finally identified HttpSendResponseEntityBody as the source of the error. The function sends entity-body data associated with an HTTP response, and as per MSDN has the following parameter:

EntityChunkCount [in] A number of structures in the array pointed to by pEntityChunks. This count cannot exceed 9999.

Microsoft don't have any SSRS documentation that addresses report size limits. At this stage all they have done is suggest that "we can use other tools for this data extracting" and that "generally we suggest put the data smaller than 100MB or the row counts less than 1,000,000".