2

I have a misbehaving 3rd party ASP.NET application that is causing IIS to crash. I can't understand how application that throws a simple, unhandled primary key exception is a sufficient reason to kill the web server process.

I was under the mistaken impression that putting a site in it's own application pool would somehow insulate other sites on the web server from errant behavior. I understand that maybe an application that had run-away resource consumption might kill the entire process, but I don't understand how one vendor's unhandled application exception can be allowed to negatively affect every other site on the web server.

I did some web searches and saw that this may happen if a site repeatedly has issues (default setting 5 times in 5 minutes) but that's not what's happening here. What's happening here is every time this exception happens, which is about once every 3 or 4 days, the whole IIS process aborts and causes a momentary outage of ALL of my sites on this web server.

I may possibly have some obscure setting misconfigured. For the most part, my IIS sites and application pools are configured with default settings and these servers have been up and running for years before this issue started occurring in September.

Any thoughts would be greatly appreciated.

System Particulars: Windows 2008 R2 IIS 7.5 Patched up to date as of last weekend


Here are parts of the 3 event entries that happen every time this issue occurs:

Application logs an unhandled exception:

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/2/ROOT

Process ID: 4680

Exception: System.Data.SqlClient.SqlException

Message: Violation of PRIMARY KEY constraint 'PK_st_GlobalSettings'. Cannot insert duplicate key in object 'dbo.st_GlobalSettings'. The duplicate key value is (Options, thread_indexerrunning).
The statement has been terminated.

StackTrace:    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at Microsoft.ApplicationBlocks.Data.SqlHelperInternal.ExecuteReader(SqlConnection , SqlTransaction , CommandType , String , SqlParameter[] , #XZc )
(rest of stack trace hidden to protect the identity of the application vendor)

IIS logs that there was an unhandled exception:

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Data.SqlClient.SqlException
Stack:
at Microsoft.ApplicationBlocks.Data.SqlHelperInternal.ExecuteReader(System.Data.SqlClient.SqlConnection, System.Data.SqlClient.SqlTransaction, System.Data.CommandType, System.String, System.Data.SqlClient.SqlParameter[], #XZc)
(rest of stack trace hidden to protect the identity of the application vendor)

Then IIS crashes:

Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18409, time stamp: 0x5315a05a
Exception code: 0xe0434352
Fault offset: 0x000000000000940d
Faulting process id: 0x1248
Faulting application start time: 0x01d02b4003b1de26
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 0f2bc4ae-97b4-11e4-ad94-001c23b85f7b
4
  • This is not IIS crashing, it's simply the app pool of the application that misbehaves. The process ID is the same in the error messages. Commented Jan 9, 2015 at 15:31
  • That's very wierd, because each pool working in independing process, and can't influe on other ones. Why I can suggest you, to check Rapid Fail Protection option in Pool advanced settings, and play with parameters Commented Jan 9, 2015 at 15:34
  • xxbbcc: Trust me, it is IIS crashing because ALL websites become unavailable when this happens and every one of my sites is set up on its own application pool. Urlil: are they separate PROCESSES or are they separate THREADS? I'll go look at rapid fail again and update you shortly. Commented Jan 9, 2015 at 16:13
  • It's not Rapid Fail Protection. The application pool does not stop, the IIS service crashes after 1 failure: Rick Strahl has a description of RFP here weblog.west-wind.com/posts/2006/Dec/19/… Commented Jan 9, 2015 at 16:16

3 Answers 3

3

Seems the expected behaviour for unhandled exceptions occuring outside of the request context is to terminate the worker process. So if your third party app is doing some async work for example, and throws an unhandled exception, this will meet the criteria. See https://support.microsoft.com/en-us/kb/911816 for more

Sign up to request clarification or add additional context in comments.

Comments

2

I have many server 2012 (IIS 8) that I administer and ALL of them are having this problem starting within 48 hours of installing Microsoft updates this month. I checked my application logs over two years and this error had never existed before this month and the only delta in the environment was January's patches!

1 Comment

I am getting this on Server 2012 and IIS8 also. Never had these issues before. Hope MS fixes it soon - have you managed to find out what is causing it?
-1

It is not IIS error. It seems it is a bad request or something else.

The clue is in :"StackTrace: at System.Data.SqlClient.SqlConnection.OnError"

2 Comments

It's an application error that is causing the entire IIS process to crash.
I believe the issue raised by this question is How is it possible for one site in one app pool to impact all the others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.