CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

An Incorrect Server Time can Crash Your Applications!

I was going to title this post “An Incorrect Server Time can Crash Your ASP.NET 2.0 Applications!” but I thought that would be too sensational… But, it’s true, my ASP.NET 2.0 apps pooped out due to a server time being off. .  Here’s what happened:

The other day we started seeing one of our two web servers crashing.  We recently deployed our new public site onto ASP.NET 2.0, and everything had been working fine up until this point.  The strange thing about this server crashing was that both servers are identical hardware, had the same codebase deployed, and are load balanced with a Cisco CSS hardware.    Why one server would begin to fail and not the other was mysterious.

Well, I went looking in the event log and saw this error, at regular intervals, every 5 minutes. It turns out that after a few of these, the server would crash, and we’d get “Service Unavailable” when browsing to that server.  This is what the event log looked like:

Source: .NET Runtime 2.0 Error Reporting
Event Id: 5000
Description: EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 microsoft.web.services2, P5 2.0.3.0, P6 42177cce, P7 eb1, P8 47, P9 e3hnjzi4pzb2exb3atbffdtvqefg3pm4, P10 NIL.

What a great description, huh? Anyhow, I did some searching and found the following KB article that let me know what was causing the crash:

Unhandled exceptions cause ASP.NET-based applications to unexpectedly quit in the .NET Framework 2.0

When an unhandled exception is thrown in a Microsoft ASP.NET-based application that is built on the Microsoft .NET Framework 2.0, the application unexpectedly quits. When this problem occurs, no exception information that you must have to understanding the issue is logged in the Application log.

Okay, nice feature.  Anyhow,  I knew that WSE was somehow involved (due to the web.services2 in the description) and that I had an unhandled exception in code somewhere (sloppy on my part).  I suspected a regular process since the errors were so periodic, and we do indeed have some processes that go off every 5 minutes and do some WSE stuff.  Well, finally with my trusty copy of SysInternal’s DebugView (which will show you Trace.Write, and Debug.Write output) I tracked it down to this error:  A WSE message failed to decrypt because it was “sent in the future.”  Sent in the future? Cool!  No wait, that’s impposible. I checked and sure enough, the server’s time was off by a minute. 

So the time was off, the message wasn’t decrypted, WSE threw an exception, my sloppy code failed to handle it, and bang!  Dead server.. I thought I’d pass this along,  this was the strangest error fix I’ve had in a while!

-Brendan

 



Comments

Luke Melia said:

We ran into the same problem recently with WSE 2.0 and a .net 1.1 web service. Took us a full day to figure it out. Weird one.
# March 2, 2006 11:16 PM

Eber Irigoyen said:

interesting, one place more to look... I find this very misleading though

"one of our two web servers crashing"

your application was crashing right? not the server?, not even IIS, or was it?
# March 3, 2006 6:27 PM

Brendan Tompkins said:

Eber.. Yes, you're right that is misleading. Our ASP.NET application was what was crashing, not the server, or even IIS.. Thanks for pointing that out...

Brendan
# March 4, 2006 11:15 AM

Alex said:

It also happens with MSN Messenger (you can't sign in)
# March 4, 2006 6:24 PM

SAL said:

I have faced a similar porblem when i built my project then tried it on another laptop it did not worked and did not even started it gave me an error
Source: .NET Runtime 2.0 Error Reporting
Event Id: 5000
Description: EventType clr20r3
the solution to this problem is to go to right click your project then choose properties then go to references tab and remove any unused references after that rebuild your project deploy it to any other machine and it should work.
# March 22, 2006 7:30 AM

Mayur said:

Hi ,

I am running my application 24*7. It works fine in day time but at night it get crashed. I am running it through scheduler.

It is giving following error in application event...

EventType clr20r3, P1 deduplix.exe, P2 1.0.3014.28632, P3 47f35fed, P4 system.windows.forms, P5 2.0.0.0, P6 471ebf68, P7 16c6, P8 159, P9 system.componentmodel.win32, P10 NIL.

please help me and tell what can i do?

Server OS is Windows server 2003 standard edition.

I am using one COM dll and one OCX.

# May 12, 2008 8:23 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!

Our Sponsors

This Blog

Syndication

News

MVP
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.