Friday, August 1, 2008

"The operation has timed out" while creating a snapshot (SSRS)

I've deployed a rather big report project with several subreports and a huge main one. That main report had two possible values for a parameter, and, depending on them, could run from 1 to 6 minutes. Well, for a customer 6 minutes was unacceptable wait time, but then the data was not supposed to be updated often, so a snapshot option looked good in this case.
In the report Properties window I opened the Execution tab and chose "Render this report from an execution snapshot" option. Then I've configured a schedule to have snapshots created daily, made sure that the "Create a snapshot of the report when this page is saved" option is checked (which is a default state), and clicked OK to save the properties...

NB! As I've mentioned, there were only two possible values for the only parameter of the main report. To run a report with parameters from a snapshot you need to have a separate version of your report with default values for each set of parameters. So, I actually had TWO reports instead of one, corresponding to two (hard-coded as a default for each version) possible values of a parameter. If you cannot allow yourself such a luxury, you need to turn to a cashing option instead...

So, I had to perform above mentioned properties setup twice. However, when I did that for the second value of a parameter (with which the report was supposed to run for 6 minutes), after just about 2 minutes of execution I got an error: "The operation has timed out"! Obviously, that was pertaining to the operation of the properties saving, because the report execution timeout was set up to unlimited time. After checking this issue on Internet I found out that other people have been fixing it by changing timeout value in system parameters... oh well, it was too much not only for me, but for our sysadmin as well. He tried several fixings, but the result was the same. After one of those fruitless attempts I looked at the project online and found that all the components are up and running except this big report, of which I got the following information:
"The selected report is not ready for viewing. The report is still being rendered or a report snapshot is not available. (rsReportNotReady)". That looked as a dead-end situation.

But then, in a due time of 6 minutes the report became available online, and has been available since then with no delay! Obviously, in spite of an error message, behind the scenes the snapshot was continuing to create!

CONCLUSION: don't panic upon seeing "The operation has timed out" error message while creating an initial snapshot of a long-running report. It could well be that in a due time the snapshot is successfully created. I killed a couple of hours (so did our sysadmin) to resolve the timeout problem, while in fact it had no impact on the resulting performance.