While batching multiple requests to SSRS I appear to get errors at random times. Currently I have for example 1000 reports waiting on a queue and 10 run in parallel (same rdl is being called).
I am calling SSRS in code.
execInfo = ssrs.LoadReport(reportPath, null);
ssrs.SetExecutionParameters(paramValues.ToArray(), null);
string encoding;
string mimeType;
string extension;
Warning[] warnings = null;
string[] streamIDs = null;
data = ssrs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);
execInfo = ssrs.GetExecutionInfo();
When exporting to Microsoft DOC format I do not get any errors however when rendering to DOCX (ASPOSE) I see the following error (around 11 of the 10000 renders).
when I run the 11 individually they pass.
rrRenderingError400An error occurred during rendering of the report.http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rrRenderingError&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=10.50.1790.0Microsoft SQL Server Reporting Services10.50.1790.01033OsIndependent1033Microsoft.ReportingServices.ProcessingCoreAn error occurred during rendering of the report.mscorlibCollection was modified; enumeration operation may not execute.
Any idea’s what I can do to diagnose the issue ?
edit:
I have attached some more error info form the SSRS logs
Thanks for your inquiry. It would be great, If you please use select statement (to populate the data ) inside your RDL file and share it with us. I will investigate the issue on my side and provide you more information.
Please see the following DataSet example with select statement for your kind reference:
DataSource1
select 1 as value, ‘label1’ as label
union all
select 2 as value, ‘label2’ as label
union all
select 3 as value, ‘label3’ as label
union all
select 4 as value, ‘label4’ as label
value
System.Int32
label
System.String
Edit: I think the problem could be due to the groupings. I removed all detail/group rows except for the TOTAL row and did not see the issue occur. Maybe that’s a starting point.
Thanks for your patience. I have exported the shared RDL file to Doc/Docx file format and have not faced any exception. It would be great if you please create a sample application with shared RDL file and share that application here for investigation purposes. I appreciate your cooperation in advance for this.
Thanks for your inquiry. I investigated your RDL with export option, one file at a time and did not found any issue. I know, the issue you are facing is with exporting RDL file in parallel (10 run in parallel (same rdl is being called). Also, after removing detail/group removes this exception.
To investigate/reproduce this issue, we need to use the same approach which you are following in your code. So, It would be great if you please create a test application with same RDL file and share it here for testing purposes. We really keen to help you but need some more details from your side.
I will look to make an example app for you. I do not understand why you do not have existing infrastructure to run reports in parallel. I would have expected this to be available to you.
attached is a sample console application that will run in parallel 1000 calls to SSRS. (Not sure how many threads are running in parallel however the error still occurs).
To run it:
ConcurrencyIssue.exe “http://{SERVER}:{PORT}/{SSRS Instance}/ReportExecution2005.asmx” “{SSRS PATH TO REPORT}/TestReport”
The first parameter is the URL to the ReportExecution2005 service and the second is the path to the report in SSRS. This will all depend on your setup.
I have attached TestReport.RDL to test with.
The code is attached and the .exe is in the debug directory. The documents are written to the debug\output directory and the error.txt file is created in the debug directory. It will show you the error.
I ran it twice on my side - the first time i saw the error was after 800 calls and the second time was after around 300 calls.
Thanks for your patience. I have tested the scenario for parallel 1000 calls with same DLL shared by Vadim at this link. Please see the attachment. It would be great if you please test the same TestReport.rdl file at your end and share your findings with us. Please restart SQL Server Reporting Services before testing. I have attached an output document with this post.
I have tried it on a second instance (on a different machine). I restarted it etc. What was interesting was that i ran the example application a couple of times and it was successful. After running it around the 4th/5th time I started to see the error.
Please can you try it a few times… OR if you want change the number of calls being made … maybe from 1000 to 3000. But I think you need to run it a few times based on what I have just seen.
I have tested the example app with caching on and have run it multiple times and have not seen the issue. I need to test it on the actual application, however SSRS caching will kick in for specific repeated parameters, and in the original identification of the problem the report was being called in parallel with differing parameter values for each call and therefore not sure if this would be a viable work around in this instance.
I will do a test though and will let you know. I would just like to confirm though - have you been able to reproduce the issue on your side ?
I have tried it on a second instance (on a different machine). I restarted it etc. What was interesting was that i ran the example application a couple of times and it was successful. After running it around the 4th/5th time I started to see the error.
Please can you try it a few times… OR if you want change the number of calls being made … maybe from 1000 to 3000. But I think you need to run it a few times based on what I have just seen.*
I have tested the same scenario for five times with parallel 1000 calls to SSRS and have not faced any issue. I am using the same TestReport.rdl report shared at this forum link. Are you using the same RDL file?