SSRS Report Viewer - ASP.Net Session Expired or not found on NLB (SQL Server)

2k Views Asked by At

Hi,

I have an issue on NLB production environment where two application servers are configured. Both have a virtual directory of ReportViewer that renders SSRS reports in an iframe using an .aspx page.

After the "ASP.NET session has expired or could not be found" error, i changed the sessionState mode=SQLServer with custom database, still the error is there. I can see session entries in the DB table as well.

What else could be missing?

-I have read somewhere that having an _ (underscore) in domain name can cause this. I have checked the URLs, there is an underscore in querystring parameter but not the domain name itself, and the querystring is auto-generated by ReporViewer ScriptResource.axd itself.

-KeepSessionAlive is also true & AsyncRendering is also true, checked these in both states, issue did not get resolved.

-cookieless is set to "false"

-ReportViewer version is following :

<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=xx" />
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=xx" />

Any help to point me in the right direction would be appreciated. Thanks :)

1

There are 1 best solutions below

6
CPorteous On

The main thing you need to think about in an NLB scenario with SSRS is ViewState. If a user is hitting a load balanced URL, their traffic could go to any of the SSRS servers in the load balancer pool. You need to set up the same machinekey on all SSRS servers to allow their session to be picked up by any of the servers.

I wrote about all the required steps in the below SQLShack post. As long as SSRS is setup like this, the front end doesn't know/care beyond the fact you are giving it a (load balanced) URL to hit. Hope that helps!

https://www.sqlshack.com/scaling-out-reporting-services-changes-in-sql-server-2016/