Friday, August 8, 2014

Crazy ASP.net error

We deployed an asp.net 4.0 site, ran all the SQL scripts and cranked it up. The first visit to the site: Page cannot be displayed. This was on windows 2008 (IIS 7) so there was no web service extensions that needed to be enabled. I registered asp.net v4 again, still no joy. The application log was flooded with errors: Event ID: 1000 Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: Faulting module name: clr.dll, version: 4.0.30319.18444, time stame: Exception code: 0xc00000fd Faulting process id: 0xb9c Faulting application start time : faulting application path: c:\Windows\SysWOW64\inetsrv\w3wp.exe faulting module path: c:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll The site served HTML pages, but anything .aspx it crashed on with the above error. When I changed the app pool identity it crashed with an asp.net error if the identity wasn't in the iis_iusrs group. If we made a change to the web.config that invalidated the web.config it would present an asp.net error. Based on all this I knew that asp.net was working and the IIS was working. It had to be a problem in the code. Looking at the code we found that application_start did a SQL server call. Upon further investigation it turns out that a SQL script the devs ran stripped the permissions from the database user the site was using. Promoting that user to have owner privileges on that database resolved the issue. The moral: crashes in the application_start don't present a good error message. If you have the code and it's acting funny like this look at that to see where the problem could be happening. Additionally, always always verify the expected accounts have proper permissions at all levels even if your head tells you things like: "it shouldn't be accessing the SQL server yet."

No comments:

Post a Comment