66

I've just deployed an update to an existing ASP.NET MVC3 site (it was already configured) and I'm getting the IIS blue screen of death stating

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

However; there is nothing showing up in the Application Event Log where I would expect to see a (more) detailed description of the entry.

How can I go about diagnosing this issue?

Greg B
  • 1,548
  • 5
  • 17
  • 32
  • I've had the exact same issue here. In my experience, if the event log is empty than the request wasn't correctly routed to the worker process. In one of our recent deployments we saw the app work intermittently with about 50% of the requests randomly failing with the 500 error and nothing in the logs. I suspect something is going wrong with the AppDomain unload that occurs after deployment. Out of curiosity, are you running antivirus in your production environment? Does an IIS reset solve the issue (until the next deployment)? – ShadowChaser Feb 21 '13 at 16:17

6 Answers6

54

Take a look at IIS7's Failed Request Tracing feature:

Troubleshooting Failed Requests Using Tracing in IIS 7
Troubleshoot with Failed Request Tracing

The other thing I would do is tweak your <httpErrors> setting because IIS may be swallowing an error message from further up the pipeline:

<configuration>
  <system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>
</configuration>

If the site is written in Classic ASP then be sure to turn on the Send Errors to Browser setting in the ASP configuration feature:

enter image description here

And finally, if you're using Internet Explorer then make sure you've turned off Show friendly HTTP error messages in the Advanced settings (though I suspect you've done that already or are using a different browser).

Kev
  • 7,777
  • 17
  • 78
  • 108
21

In my case:

  • The Event Log was empty.
  • web.config wasn't corrupt - verified by using same on local machine / using inetmgr

Finally...

  • Checking IIS logs showed a request like this

...Chrome/57.0.2987.133+Safari/537.36 500 19 5 312

The key being:

sc-status sc-substatus sc-win32-status 500 19 5

which with some googling pointed me to the IIS_USRS not having read permissions to the www folder

fiat
  • 767
  • 11
  • 16
  • 6
    I found the list of status codes here: https://support.microsoft.com/en-us/help/943891/the-http-status-code-in-iis-7-0--iis-7-5--and-iis-8-0 – sirdank Jan 24 '18 at 18:35
4

The most obvious issue is improper or zero NTFS rights on the web application folder. So make sure the account serving the site has the right permissions. Without proper NTFS rights to the web directory it doesn't matter what you put in the web.config as it will never be read.

A quick check can be to give everyone full rights - if the site starts working then you know it's a rights problem and you can then set about assigning appropriate rights to a more appropriate account.

rism
  • 301
  • 2
  • 12
2

If upgrading from IIS6, then it may be one of the the web.config works on 6, but not in IIS 7.5 ... Double click on all the icons in IIS for the website and you may get an error about the format (Section must be below other section...)

M Hall
  • 31
  • 1
0

I ran in this issue many times. 500 error from a ASP.NET 4.x website. No details in the eventLog and even the tracing above didn't help. In my case it was caused by the fact that the web.config contains rewrite rules. So check your web.config if it has something like:

<system.webServer>
  <rewrite>
    <rules>
      ...
    </rules>
  </rewrite>
</system.webServer>

If it does, you need to install iis rewrite module:

https://www.iis.net/downloads/microsoft/url-rewrite

Maarten Kieft
  • 121
  • 1
  • 6
0

I had the same problem with an Azure Web App. While debugging locally, error messages (JSON) returned from ajax calls were fully returned to the browser. But once deploy to the Web App, the messages were swallowed and i was returned a default 500 error message. So I had to explicitly set the existingResponse value to PassThrough in the web.config httpErrors tag.

Loul G.
  • 139
  • 2