<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>John Gallardo's Weblog : rsExecutionNotFound</title><link>http://blogs.msdn.com/jgalla/archive/tags/rsExecutionNotFound/default.aspx</link><description>Tags: rsExecutionNotFound</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Scaling out the Viewer Control and rsExecutionNotFound</title><link>http://blogs.msdn.com/jgalla/archive/2008/08/08/scaling-out-the-viewer-control-and-rsexecutionnotfound.aspx</link><pubDate>Fri, 08 Aug 2008 19:26:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8843777</guid><dc:creator>jgalla</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/8843777.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=8843777</wfw:commentRss><description>&lt;p&gt;One of the criteria that the report server uses to match the provided SessionID with a stored report is that the SessionID has to be provided by the same user that initially created the session.&amp;nbsp; Usually, this is the case.&amp;nbsp; Someone browses the report in IE, they click around to paginate or expand toggles, and things just work because they are the same user they were when they initially ran the report.&lt;/p&gt; &lt;p&gt;Sometimes though, things go wrong.&lt;/p&gt; &lt;p&gt;One way that this can happen is when you are hosting the ASP.Net Viewer Control in your own application and you are not impersonating the incoming user all the way to the backend report server.&amp;nbsp; This is a totally supported configuration, however there is a little caveat that you have to keep in mind.&amp;nbsp; Since the report server requires that the user names match across session retrievals, you have to ensure that the viewer control is impersonating the same user.&amp;nbsp; Sounds easy, right?&amp;nbsp; Well not so fast if you are using a machine specific account for your application pool which is hosting the viewer control.&amp;nbsp; The specific topology that can get you into trouble is something like the following:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalla/WindowsLiveWriter/ScalingouttheViewerControlandrsExecution_8052/image%7B0%7D%5B12%5D.png" atomicselection="true"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="232" src="http://blogs.msdn.com/blogfiles/jgalla/WindowsLiveWriter/ScalingouttheViewerControlandrsExecution_8052/image%7B0%7D_thumb%5B10%5D.png" width="405" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;In this scenario you have the following:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Client machines accessing multiple web frontends hosting the report viewer control via a load balancer.&lt;/li&gt; &lt;li&gt;The web frontend machines are using a machine-specific account to communicate with the report server (for example they are using the builtin NETWORK SERVICE account).&lt;/li&gt; &lt;li&gt;You are &lt;strong&gt;not &lt;/strong&gt;impersonating the incoming user in the viewer control when accessing the backend report server.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The sequence of operations that can lead to trouble are:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;The initial request from ClientA is routed to MachineA.&amp;nbsp; &lt;/li&gt; &lt;li&gt;The viewer control in MachineA instantiates a session with the report server.&amp;nbsp; Since the $MachineA credentials are sent, the session is associated with this user.&amp;nbsp; Keep in mind at this point the report server actually has no idea that there is some other logical user beyond the web frontend that is actually making the request.&lt;/li&gt; &lt;li&gt;The user views the first page of the report, and navigates to the second page.&lt;/li&gt; &lt;li&gt;The request for the second page is actually routed to MachineB by the load balancer.&lt;/li&gt; &lt;li&gt;The viewer control in MachineB attempts to load the user session, however this fails since the request to the report server is actually from $MachineB user and not the original $MachineA user.&amp;nbsp; The report server generates an rsExecutionNotFound error and returns that, resulting in an error being displayed to the user.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;There are a couple of ways to address this problem:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Architect your application such that you can flow credentials from the client all the way to the report server.&amp;nbsp; -- Or --&lt;/li&gt; &lt;li&gt;Ensure that your web frontend nodes can impersonate the same user when accessing the report server regardless of which machine the request is routed to (so use something like domain credentials to access the report server).&lt;/li&gt;&lt;/ol&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8843777" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/rsExecutionNotFound/default.aspx">rsExecutionNotFound</category></item><item><title>Aggregating rsExecutionNotFound Posts</title><link>http://blogs.msdn.com/jgalla/archive/2007/02/01/aggregating-rsexecutionnotfound-posts.aspx</link><pubDate>Thu, 01 Feb 2007 20:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1574381</guid><dc:creator>jgalla</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/1574381.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=1574381</wfw:commentRss><description>&lt;P&gt;The posts about things dealing with rsExecutionNotFound seem to be what people find most interesting these days.&amp;nbsp; In order to aggregate the posts into one place, I will be adding links that deal with this error here. &lt;/P&gt;
&lt;P&gt;Maybe I will add a tag as well...&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A title="Careful when using rc-Toolbar=false" href="http://blogs.msdn.com/jgalla/archive/2007/01/31/careful-when-using-rc-toolbar-false.aspx" mce_href="http://blogs.msdn.com/jgalla/archive/2007/01/31/careful-when-using-rc-toolbar-false.aspx"&gt;Careful when using rc-Toolbar=false&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A title="Session Timeout during execution" href="http://blogs.msdn.com/jgalla/archive/2006/10/11/session-timeout-during-execution.aspx" mce_href="http://blogs.msdn.com/jgalla/archive/2006/10/11/session-timeout-during-execution.aspx"&gt;Session Timeout during execution&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1574381" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/rsExecutionNotFound/default.aspx">rsExecutionNotFound</category></item><item><title>Careful when using rc:Toolbar=false</title><link>http://blogs.msdn.com/jgalla/archive/2007/01/31/careful-when-using-rc-toolbar-false.aspx</link><pubDate>Thu, 01 Feb 2007 02:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1568185</guid><dc:creator>jgalla</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/1568185.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=1568185</wfw:commentRss><description>&lt;P&gt;I'm in the middle of reinstalling Visual Studio, and so I thought I would share an interesting story from a couple of weeks ago.&amp;nbsp; An internal customer (Microsoft-speak for some other team at Microsoft) of Reporting Services was encountering seemingly random rsExecutionNotFound errors when navigating around their application.&amp;nbsp; Of course, things like this are never random and there was a perfectly good explanation.&amp;nbsp; After digging through their application for a little while, and with the help of &lt;A href="http://www.fiddlertool.com/fiddler/" mce_href="http://www.fiddlertool.com/fiddler/"&gt;Fiddler&lt;/A&gt;, I stumbled upon the problem.&amp;nbsp; They were rendering the same report in two different contexts, one of them was specifying rc:Toolbar=false, and the other wasn't.&amp;nbsp; Basically, their call to the report server looked something like this in the two places:&lt;/P&gt;
&lt;P&gt;http://reports/reportserver/?/myreport&amp;amp;rs:Command=Render&amp;amp;rc:Toolbar=false&lt;/P&gt;
&lt;P&gt;http://reports/reportserver/?/myreport&amp;amp;rs:Command=Render&lt;/P&gt;
&lt;P&gt;Now, there is actually a subtle little problem with rendering using rc:Toolbar=false against the ReportServer virtual directory.&amp;nbsp; When this happens in a default installation, the Report Server sends a cookie back to IE to identify the session.&amp;nbsp; This cookie is then passed back to the report server to load up the appropriate snapshot, parameter, data source information, etc to view subsequent pages and images from the report.&amp;nbsp; What would happen is the user would navigate to the page where the report being rendered w/rc:Toolbar=false was sitting, which would give IE the cookie.&amp;nbsp; The user would navigate away from the page, and eventually head to the page where rc:Toolbar=false &lt;STRONG&gt;was not&lt;/STRONG&gt; specified.&amp;nbsp; However, even in this case if the cookie is there, we try to use it to load the user session, which would fail because the session had timed out in the time between the two requests.&amp;nbsp; The user would be greeted with an "Execution Not Found" error message and would have to close and restart IE to get things working again.&lt;/P&gt;
&lt;P&gt;The moral?&amp;nbsp; Don't render against the ReportServer virtual directory using rc:Toolbar=false unless you really know what you are doing, because it is tricky to get right.&amp;nbsp; If you want to render using the ReportServer virutal directory (so you don't have to roll your own &lt;A href="http://www.gotreportviewer.com/" mce_href="http://www.gotreportviewer.com/"&gt;Report Viewer Control ASP.Net application&lt;/A&gt;) then you &lt;A href="http://msdn2.microsoft.com/en-us/library/ms345247.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms345247.aspx"&gt;should build a stylesheet which removes the toolbar, and use that&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1568185" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/rsExecutionNotFound/default.aspx">rsExecutionNotFound</category></item><item><title>Session Timeout during execution</title><link>http://blogs.msdn.com/jgalla/archive/2006/10/11/session-timeout-during-execution.aspx</link><pubDate>Wed, 11 Oct 2006 23:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:817495</guid><dc:creator>jgalla</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/817495.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=817495</wfw:commentRss><description>&lt;P&gt;Reporting Services has a notion of a user session.&amp;nbsp; This is not the same as ASP.Net's notion of a user session, and in fact the two are completely orthogonal to each other.&amp;nbsp; SSRS's session maintains information about which report a user is looking at, the data that is in that report (we call this a snapshot), the interactivity state (what items are shown/hidden), parameter state, etc...&amp;nbsp; These sessions are aged out based on the last time they were accessed.&amp;nbsp; For most scenarios where you use the viewer control, you should never have to worry about sessions because it will automatically ping the SSRS web server to keep the user's session alive.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;However, there is one scenario where the ping doesn't work, and that is during the inital report execution.&amp;nbsp; The problem is that while the report is being executed, the user's session is locked (as we are populating the user's temporary snapshot)&amp;nbsp;and the keepalive from the viewer control will be blocked.&amp;nbsp; Normally, this is not a problem because report executions aren't supposed to take a long time and quite often they finish before the session timeout hits.&amp;nbsp; Unfortunately, there are some cases where reports (for whatever reason) take an incredibly long time to execute.&amp;nbsp; What happens in this case is that the user's session is aged out while the report is being executed, resulting in all sorts of strange behavior.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Fortunately, there exists a couple of solutions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;Reduce the time it takes to run the report.&lt;/STRONG&gt;&amp;nbsp; Generally this involves simplifying the report or moving some of the aggregation/sorting to the database layer (RDBMSs are generally better at this than we are).&amp;nbsp; 
&lt;LI&gt;&lt;STRONG&gt;Consider running the report offline.&lt;/STRONG&gt;&amp;nbsp; Try creating a schedule by which the report is executed during off-hours, and users only see this snapshot of the data.&amp;nbsp; This can greatly improve execution performance for large reports which involve lots of grouping/sorting in the report server. 
&lt;LI&gt;&lt;STRONG&gt;Consider delivering the reports via a subscription.&lt;/STRONG&gt;&amp;nbsp; Probably your user doesn't want to leave IE sitting open for&amp;nbsp;two hours waiting for a report to render.&amp;nbsp; It is too easy to accidently close the window and now he or she is back at square one.&amp;nbsp; If you have a report which takes hours to generate, consider creating a subscription and delivering the report to the person via email or a file share.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;If none of these solutions really work for you, then as a last resort you can modify the SessionTimeout and SessionAccessTimeout system properties.&amp;nbsp; You should configure these values to be no less than the time it takes to render your largest report.&amp;nbsp; Here is a sample script for rs.exe which will set these values for you:&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:374833cd-ba11-462b-9f6e-8fb5ce6e07a1 contentEditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;PRE style="BACKGROUND-COLOR: #dfdfdf"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #0000ff"&gt;Public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;Sub&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Main()
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;Dim&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; props() &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;]
    props &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;] () { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;](), &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;]() }
    
    props(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).Name &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;SessionTimeout&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
    props(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).Value &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; timeout
    
    props(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).Name &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;SessionAccessTimeout&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
    props(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).Value &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; timeout
    
    rs.SetSystemProperties(props)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;End Sub&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can run this script with the following command:&lt;/P&gt;
&lt;DIV class=wlWriterSmartContent id=57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:f1d4782e-ad99-4ce8-8a90-a95369b2c78c contentEditable=false style="PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; FLOAT: none; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px"&gt;&lt;PRE style="BACKGROUND-COLOR: white"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #000000"&gt;rs -i sessionTimeout&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;rss -s http:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;//&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;localhost&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;reportserver -v timeout&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;6000&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;The timeout is expressed in seconds, so this example sets the SessionTimeout and SessionAccessTimeouts to&amp;nbsp;about an hour and a half.&amp;nbsp; Note that you should do this with caution, keeping a session around longer than necessary can cause your ReportServerTempDB database to grow larger since temporary session snapshots will not be aged out as often.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=817495" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/rsExecutionNotFound/default.aspx">rsExecutionNotFound</category></item></channel></rss>