views:

1398

answers:

5

Sorry for the vague title, 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 a Classic AppPool (and no I cannot run in Integrated).

When trying to load an *.aspx file for the first time (i.e. after installing site, restarting 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
Logon Method: Anonymous
Logon User: Anonymous

The handler is the default IIS7 one:

<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 in my own handler for aspx that 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 did was change the Handler part of the error notification to say IsapiModule.

The odd thing is that this error only occurs the first time (or when the server has been idle for hours). As soon as I see this error, if I refresh the page it's all fine and dandy again.

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

I can't seem to find a single answer for this problem on the internet.

Edit: I 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="The operation identifier is not valid. (0x800710dd)", ConfigExceptionInfo=""

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 run the difference is that the error produces MODULE_SET_REPONSE_ERROR_STATUS whereas the successful run doesn't (and then goes on to produce the correct HTML output).

Edit: I took a simple app and tried to get that running and I received the same error. But when the apppool was in Integrated mode it ran fine! Unfortunately I cannot migrate our app to integrated for reasons I cannot specify but I narrowed it down to the app pool. Also I don't have to restart the server to repro the error, instead recycling the app pool will do.

Summary:
- As mentioned below there's nothing in the Event Logs to indicate failure. I combed through all logs in Event Viewer

A: 

Sounds like something while starting up the app pool. But it should be logging the actual error in the event viewer. Or you could turn CustomErrors off to debug it. The thing is, you need to see the actual error to figure out what's going on.

marcc
Yes and that's where the problem is. I don't know where to see this error. There is absolutely nothing visible as far as I can tell (other than the 500 error)
royrules22
Oh and CustomErrors is on. That's how I got the error info in the first place.
royrules22
A: 

When ASP.NET application starts loading, you may have some code that may take too long to execute, probably too big application variables or resources initialization.

The best way is to setup some sort of ping monitor, lot of ISPs provide pinging monitors that can monitor your html url on regular interval, that may help keeping your application all time alive !!

Try looking into initialization procedures of your asp.net app, you may want to increase some timeout values !!

Akash Kava
Well this happens to a Hello World app and I'm pretty sure that doesn't have a long initialization process.Furthermore the page loads fine on the second try (even if I delete the server's cache and all temporary and compressed files)
royrules22
A: 

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

You should be able to catch the exception and log it if it's coming from the ASPX code (which is quite possible).

I've seen sporadic errors like this before, I just can't remember the underlying cause at the moment.

How to: Handle Application-Level Errors

Michael Maddox
A: 

Well I don't know what was causing this but a clean install of the VM I was using fixed it. Hurrah!

royrules22
A: 

I have the same issue. Does anyone have any more info on the source the 500s? I can see them in the IIS logs, but nothing in the event logs at all

Dav Evans