IIS7 periodically throws 500 errors. Can someone help me diagnose it?

Sorry for the vague name, as I really can't explain this problem succinctly.

Basically I have Windows Server 2008 x64, IIS7, ASP.NET 2.05, and I have a site running in Classic AppPool (and no, I can't work in Integrated).

When I try to download the * .aspx file for the first time (i.e. after installing the site, rebooting the server, etc.), I get this error:

HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.

Module: IsapiModule
Notification: ExecuteRequestHandler
Handler: PageHandlerFactory-ISAPI-2.0-64
Error Code: 0x800710dd
Login Method: Anonymous
Login User: Anonymous

The handler is IIS7 by default:

<add name="PageHandlerFactory-ISAPI-2.0-64" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" /> 


I even tried adding to my own aspx handler, which looked like this:

 <add name="aspx" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" /> 

The only thing that was done was to change the part of the error notification handler to say IsapiModule.

It is strange that this error occurs only for the first time (or when the server has been idle for several hours). As soon as I see this error, if I refresh the page, everything will be fine and dandy again.

I even tried deleting the web.config file and did nothing.

I can not find a single answer for this problem on the Internet.

Edit: I have enabled Failed Request Tracking, and this is what it shows:

MODULE_SET_RESPONSE_ERROR_STATUS Warning ModuleName = "IsapiModule", Notification = "EXECUTE_REQUEST_HANDLER", HttpStatus = "500", HttpReason = "Internal server error", HttpSubStatus = "0", ErrorCode = 0, Identifier = 0, Identifier 0, Identifier 0, Error ID, Data ID, Error, Error, Code, Error, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Error, Code, Error, Code, Error, Code, Error, Code, Error, Code, Error, Code, Error Code, Error Code, Error Code, Error Code, Error Code, Error ID, Error ID, Error ID, Error ID, Error ID, Error Code

And right before the error, it shows:

NOTIFY_MODULE_START ModuleName = "IsapiModule", Notification = "EXECUTE_REQUEST_HANDLER", fIsPostNotification = "false", fIsCompletion = "false"

Now, when I compare this to a successful launch, the difference is that the error creates MODULE_SET_REPONSE_ERROR_STATUS, while the successful launch fails (and then continues to produce the correct HTML output).

Change I took a simple application and tried to execute it, and I got the same error. But , when the application was in integrated mode, it ran perfectly ! Unfortunately, I can’t transfer our application to the integrated one for reasons that I can’t specify, but I narrowed it down to the application pool. Also, I do not need to restart the server in order to reproduce the error; instead, the utility for the application pool will be used.

Summary:
- As mentioned below, there is nothing in the event logs to indicate a denial. I looked through all the logs in the event viewer

+4
source share
6 answers

Well, I don’t know what caused this, but the clean VM installation that I used fixed it. Hooray!

0
source

The best thing to do is enable the Failed Request Tracing feature in the IIS section of the website. You can then turn on some filters that give you more details.

You can do this through IIS Manager. Click on your website, then in the IIS section in the Features section, double-click the Failed Request Tracking Rules.

Most likely, it is not turned on, so from the rightmost column, select "Edit site trace". Check the box "Enable" and pay attention to the directory.

Then you can either add a rule on this screen, or go to your application, and from there open the IIS function with the function of tracking failed requests.

From the rightmost column, click "Add ...". Then go through the wizard and configure the log.

Download the page that returns the error again. Go to the registration folder and double-click the XML file. There is XSL in this directory. Do not hold it, because once it leaves, it will not be recreated .: s The converted XML will show you more information than you can hope for.

I just used this evening to find a custom error page that I configured, used ~ / instead of "/", causing IIS to die.

+3
source

It looks like when you start the application pool. But it must log the actual error in the event viewer. Or you can disable CustomErrors to debug it. The fact is that you need to see the actual error to find out what is happening.

0
source

When the ASP.NET application starts loading, you may have some code that may take too much time, perhaps too large application variables or resource initialization.

The best way is to set up some kind of ping monitor, many internet service providers provide ping monitors that can monitor your html url at regular intervals, which can help keep your application alive.

Try to learn how to initialize your asp.net application, you can increase some timeout values ​​!!

0
source

Do you have a raw exception handler in your ASPX code (something like Global Application_Error)?

You should catch the exception and register it if it comes from ASPX code (which is quite possible).

I have seen sporadic errors like this before, I just can’t remember the root cause at the moment.

How to handle application level errors

0
source

You should add this script to your web.config:

 <system.webServer> <handlers> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </handlers> 

I hope this help! Do not lose heart.

0
source

All Articles