0

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 :)

zeppelin
  • 451
  • 1
  • 4
  • 24
  • There is a dash '-' in domain name, can that be a cause of issue? – zeppelin Oct 19 '17 at 11:57
  • Is it the session timing out in your client app or ssrs page or both? – Ross Bush Oct 19 '17 at 18:13
  • Scriptresource.axd of reportviewer control makes an xhr call and gets session timeout error in response. The client app has no session management itself, its just an aspx page with reportviewr control on it, the webconfig of that client app contains that sessionState mode=SqlServer tag which i think is for ssrs session by default, correct me if am wrong. – zeppelin Oct 19 '17 at 18:16
  • Checked through localhost of both nodes and a new session entry is made in the aspstate db when the reportviewer is opened for the first time, meaning that both nodes can reach the aspstate DB, then randomly the session not found or expired error occurs, this could be on the 3-4th hit or after 20th-25th hit, theres no set pattern. – zeppelin Oct 19 '17 at 18:20
  • Also, checked event viewer of both servers, both have a session expired entry in the event viewer log meaning the error is being thrown by either of the servers randomly and not limited to only one server. – zeppelin Oct 19 '17 at 18:21
  • I would think that if you embedded a ReportViewer into a web application and that web application has a web.config with session enabled then the session configuration is for your web app not the report viewer. – Ross Bush Oct 19 '17 at 18:28
  • SSRS has two levels of timeouts. Also, depending on how your app is configured, it can also timeout. Make sure the timeout is not coming form your web app. If you put a control on your web page and you do not refresh that page, such as an ajax call in an IFrame, then your app could be timing out, not ssrs. – Ross Bush Oct 19 '17 at 18:32
  • Alright, but that i think report viewer behind the scenes uses asp.net session management by default, so maybe both client app and report viewer has a single session management mechanism and in my case it is outproc i.e sql server, am i right? – zeppelin Oct 19 '17 at 18:32
  • @RossBush i think both are using the same session management, and i have set the timeout to 60minutes so the session cannot be timedout that early, to rule out if iframe was the problem child i tried opening the aspx page in a new browser tab itself without iframe and session timeout in that as well. – zeppelin Oct 19 '17 at 18:35
  • How can i tell if the webform app is timing out or the ssrs report session, acc to me they both are using the same session mechanism and that is set in the webconfig of the webform application. Please let me know if there is any thing else i can look into – zeppelin Oct 19 '17 at 18:36
  • @RossBush what are the 2 levels of timeout, what can i check which is causing it, – zeppelin Oct 19 '17 at 18:38
  • 1
    The report server has a global response timeout and each report has a timeout setting in ssrs. However, if I remember those come back as "Report Processing Timeout" not "Session Timeout". I would stick with your assumption. Here is a link as to what I was trying to explain. https://stackoverflow.com/questions/21011759/ssrs-session-cookies-report-viewer-control – Ross Bush Oct 19 '17 at 18:42
  • There are also timeout in the report server config files but they are mainly for rendering timeouts. – Ross Bush Oct 19 '17 at 18:44
  • @RossBush hmm right, just let me know if any thing else comes to your mind that might be causing it, thanks for the help btw. – zeppelin Oct 19 '17 at 18:49

1 Answers1

1

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/

CPorteous
  • 957
  • 6
  • 10
  • Alright, By NLB i was referring to Application Servers (IIS) NLB and not SSRS Report Server on NLB. I am not sure of it as of now as I currently dont have production server access. However I will check that too, Just a quick question, Do I have to put the same machine keys used in IIS application's web.config in the report manager's web.config as well. Also, for sessionState, i have implemented SqlServer mode for the 2 applications & not the report managers on 2 different nodes, Do I have to configure them with sqlServer as well. Thanks for useful link. – zeppelin Oct 23 '17 at 09:49
  • 1
    @zeppelin, Ah, slightly different situation then. For the machine Key, I think you can add the same machine key to the .NET folder on all servers and that serves all IIS based applications on that server. I believe its in here you change it: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG For SSRS Report manager, you'll need all nodes in a scale out deployment, sharing the same DB. You'll want them sharing a single URL using IIS LoadBalancing or the NLB. They could use their individual URLs though (ie. http://server1/reports & http://server2/reports). All depends on how its set up :) – CPorteous Oct 23 '17 at 09:54
  • Man I checked both Application servers (IIS) and both Report Servers - both layers are on NLB - everything seems alright.Both IIS Servers & both Report servers have machine keys in sync. IIS Servers have SessionState = SQLServer whereas ReportServers have SessionState = InProc. Also, the error says 'Asp.Net Session could not be found or has expired' & I think ReportServer doesn't use Asp.Net session management which leads me to believe that the error is coming from my .aspx page that contains the .net report viewer control. What do you say? What else should i check? Any idea. – zeppelin Oct 26 '17 at 09:12
  • It's quite hard to picture your environment. I think if you strip it all back to just SSRS. As long as that is set up a specific way, anything that addresses SSRS's NLB url should be fine. So... if SSRS has a URL like http://Reporting.company.com. Then inside the NLB pool you have Server1 & Server2 your setup in SSRS should be like this: - ReportServer web.config: - rsReportServer.config: Reporting.company.com http://Reporting.company.com/reportserver - Scale out deployment should include both servers. ... – CPorteous Oct 26 '17 at 09:19
  • 1
    Your web.config files or the Machine.config files in both SSRS Servers should include the same manual machinekey or the autogenerated option. If you have all that setup, try hitting SSRS direct from the http://Reporting.company.com URL. Go through a few reports. Does it all work. You need to be using it for a good 10mins or more, hopefully pushing you across both servers (Check your ExecutionLog3 table.) Do you see both servers rendering reports. If so, your SSRS setup is golden. The issue lies in your application server(s). Best I can offer so far Im afraid :) Hope that helps – CPorteous Oct 26 '17 at 09:25
  • Well i checked everything, seems like the issue was with Front end app's session management, the infrastructure team configured a sticky session for application servers and the issue got resolved. But still, as the sessionState was OutProc(SQL Server) I still cannot understand why was it not working, It should not require a sticky session when the sessionState is outproc. – zeppelin Nov 09 '17 at 11:04