English 中文(简体)
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_MACHINESYSTEMCurrentControlSetServicesaspnet_stateParametersAllowRemoteConnection. 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?

最佳回答

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

问题回答
  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

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.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签