So I have an ASP.NET webforms application with many reports embedded in pages using the rsweb:ReportViewer control. These reports were written before I got here, using Sql Server BIDS 2005 and the people using these reports have been experiencing a number of issues (note: to access these reports through our site a user needs to be logged in, but I don't think this is the issue). Also, our reporting servers are running Sql Server 2008 R2. Here is a brief description of what is going on:
- When coming to a report for the first time it runs automatically and it either renders perfectly, or throws an 'rsReportNotReady' selected report is not ready for viewing error
- The user then clicks the 'run' button to execute the report again, and it will render with the correct data, but the font is slightly bigger and the images do not render (I see 'stream not found' errors in the ssrs logs)
- The user then clicks to run the report a third time, and gets kicked out of the site
- I removed the images from the report and the 'logout issue' has stopped, but the report will still lose its formatting (some bolding, some underlining, etc...basic stuff, no expressions or anything data-driven)
- I can run the report clicking the button over and over and the report will always run correctly the first time, then eventually it will run without the formatting, then eventually it will get the formatting back.
- I am not using caching or snapshots, and have selected to always use the latest data
- Timeouts are set to defaults
In the SSRS logs, when the report renders correctly I see the following:
library!ReportServer_0-8!f5c!09/03/2013-13:40:06:: i INFO: RenderForNewSession('report path here')
webserver!ReportServer_0-8!f5c!09/03/2013-13:40:06:: i INFO: Processed report. Report='report path here', Stream=''
When the report renders and loses formatting I see this:
library!ReportServer_0-8!16bc!09/03/2013-13:38:29:: i INFO: RenderForNewSession('report path here')webserver!ReportServer_0-8!16bc!09/03/2013-13:38:35:: i INFO: Processed report. Report='report path here', Stream=''
library!ReportServer_0-8!f5c!09/03/2013-13:38:35:: i INFO: RenderForNewSession('report path here')
Also in the ReportServerTempDB.dbo.SnapshotData, the successful runs create 1 row, whereas the unsuccessful runs create 2 rows with separate SnapshotDataID's, but all the params are the same for both records. As you can see, the 'RenderForNewSession' is getting logged twice a few seconds apart when the report is failing.
Running the report through ssrs manually on the report server or through the development environment I get no issues ever.
One thing I tried was to turn on caching, and have set the expiration of the cached copy to 1 minute (also tried 5 min, but this I think is irrelevant as the subsequent behavior was the same). Once I turned on caching, I have not been able to reproduce the issue and it seems to be resolved! I even added the images back in, and there are no stream-related errors or anything.
Now, I want to understand WHY this was happening without caching turned on. When you choose caching, do all renderings of the report pull from the cache INCLUDING THE FIRST RUN? I know every run with the same parameters pulls from the cache until the cached copy has expired, at which point running the report will create a new cached version, but I haven't been able to find out any information regarding the initial rendering of the report.
It's like without the caching, SOMETIMES there will be two calls made out to the report server and they are stepping on each other, and then the issue goes away, and comes back. I have not been able to find anything that stands out with verbose logging turned on (no exceptions, errors, etc.), nothing useful after turning on HTTP logs on the report server.
I know there are a lot of paragraphs here, but if anyone can shed any light on this, I would greatly appreciate it, because I don't feel comfortable implementing a fix and not knowing WHY it works!
Thanks in advance!!
Joe