Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suddenly getting "Unable to make the session state request to the session state server"

The setup: 2 web servers and a seperate state server

I have two production web servers in a load balanced configuration. The ASP.NET web app they host shares state (like a web farm) using this line in their web.configs:

<sessionState mode="StateServer" stateConnectionString="tcpip=9.9.9.9:42424" cookieless="false" timeout="60"/>

9.9.9.9 is the IP of the machine the asp.net session state service is running on (ok it's not 9.9.9.9 really, changed to protect the innocent). It's a third machine (the database server, actually.

It worked fine until...

The error: website down!

Suddenly the site went down, just showing a generic asp.net error page ('turn custom errors off to see this error' or whatever).

The app's log recorded the actual error message:

An unhandled exception occurred Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

So it appears that the web app was unable to contact the state server (9.9.9.9).

I "tried turning if auf and then onnegen" - restarting the state server fixed the problem.

Why?

I really want know what happened and why so I can prevent it happening again.

So far all I have are two theories:

  1. A windows update, to .net framework 4, was applied around that time on the state server. So maybe the update did something to the asp.net state service? The windows event viewer showed that .net 4 had logged a warning around then:

    Updates to the IIS metabase were aborted because IIS is either not installed or is disabled on this machine. To configure ASP.NET to run in IIS, please install or enable IIS and re-register ASP.NET using aspnet_regiis.exe /i.

  2. Some kind of temporary network problem between the prod web sites and the state server? They do sit right next to each other in the same physical rack though.

  3. ??? Any other ideas, anyone?

Anyone seen this before, or able to correct me on anything?

like image 222
MGOwen Avatar asked Nov 12 '10 01:11

MGOwen


People also ask

How do I enable session state in IIS?

To enable in-process session state by using the UIOpen IIS Manager and navigate to the level you want to manage. In Features View, double-click Session State. On the Session State page, in the Session State Mode Settings area, click In process.

What is session state How do you maintain session state explain the uses for session state?

ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This means that a Web server treats each HTTP request for a page as an independent request.


3 Answers

Has this happened since? The easy answer is that the problem was with the db server, not the web app. Are there any relevant errors in the log on the db server?

The fact that both apps threw an error indicates that a common resource was the problem. We chased a similar issue for a good solid week awhile back, and eventually found a faulty fiber channel gadget. (that's below my OSI level, not sure about the details).

like image 52
3Dave Avatar answered Oct 20 '22 04:10

3Dave


  1. Start–> Administrative Tools –> Services

  2. Right-click over the ASP.NET State Service and click “start”

It is working fine We need to follow the steps

like image 22
Sakthivelu Avatar answered Oct 20 '22 02:10

Sakthivelu


Had a similar issue before when our Infrastructure team tried sneaking in an install of 3.5 when they forgot to install it on our Production box. Not bouncing a server after a framework update is just going to cause all kinds of weird problems.

like image 3
meinmkv Avatar answered Oct 20 '22 02:10

meinmkv