How to fix "Failed in BaseWorkerRequest::SendHttpResponse Value does not fall within the expected range" in Reporting Services 2016?

Michał Malewski 0 Reputation points
2023-04-28T07:30:53.0366667+00:00

Hi,

I have a problem with generating huge report to PDF File. In log I can find:


rshost!rshost!444!04/20/2023-16:48:20:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!444!04/20/2023-16:48:20:: e ERROR: Failed with win32 error 0x0057, pipeline=0x000001711039FB10.
httpruntime!ReportServer_0-1!444!04/20/2023-16:48:20:: 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!444!04/20/2023-16:48:20:: 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_MSSQLSERVER_0-1-133264663787788551.  ---> 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!444!04/20/2023-16:48:20:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!444!04/20/2023-16:48:20:: e ERROR: Failed with win32 error 0x10DD, pipeline=0x000001711039FB10.



Report logic / Data comes from our ERP System. Report has 1310758 records and 480135405 bytes (info from ExecutionLog). Generating data goes smoothly. Above error occurs in my opinion at the end of rendering to file.

Additionally, when I ran the same report as RDL (print to screen), generating ends successfully. But when I want to export generated to screen report to PDF file after few minutes I see OutOfMemory Exception.

I have two environment of our ERP System. On the old one, report runs without any troubles. Above error occurs only on new environment. So there is might be difference of version or difference in some configuration.

New environment: OS Version: 2016, SQL: 13.0.6404.1, RS: 13.0.6300.2

Old environment: OS Version 2012 R2, SQL: 13.0.4466.4, RS: 13.0.4466.4

I've already extended maxRequestLength and executionTimeout in httpRuntime in web.config to max of int32, but it not fix my issue.

What else I can check or change?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,988 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AniyaTang-MSFT 12,446 Reputation points Microsoft Vendor
    2023-04-28T08:43:19.1333333+00:00

    Hi @Michał Malewski

    Out of memory is an error thrown by Reporting Services when an operation requests more memory from the system and the system is unable to provide it.

    Ways to solve the problem are:

    1. Add enough physical memory to the computer
    2. Upgrade to a 64-bit version of Microsoft SQL Server Reporting Services
    3. Schedule the report to run at a time when memory limits are low.
    4. Adjust the MemoryLimit settings accordingly: https://learn.microsoft.com/en-us/sql/reporting-services/report-server/configure-available-memory-for-report-server-applications?view=sql-server-ver16.

    You can try what you can do.

    Best regards,

    Aniya


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.