Imagine the nightmare…you decided to sneak in a web part deployment in right before the start of the business day. Right after your deployment you see that the site is about to come back up…and…then nothing. A blank screen. In desperation you open Internet Explorer to try and see if it loads there as well..nothing but a 500 error. Then, the feeling rushes over you that this was a very bad decision. While we should address why you were doing an early morning deployment we shall spare you. 🙂 So what do you do now?
One of the best ways to see what is going on with a 500 error is to enabled Failed Request Tracing in IIS for the web site in question. Once enabled you can replicate the issue by refreshing the browser a few times; this should be more than enough to capture a few. Once captured then you will usually see where the issue is identified (especially with web.config changes that happen).
To do this:
1) Open IIS
2) Select the web site in question and open the Features View
3) Under the IIS section select “Failed Request Tracing” by double-clicking it
4) In the top right hand corner click the message in the Alerts section
5) When the pop-up comes up then select to enable and take the default directory (unless you need it elsewhere, then specify another location) and hit OK
6) Next, under actions select “Add…” and select “All content (*)” and click Next
7) Indicate the status code of 500 (and others where applicable) and click next again
8) Indicate your trace providers and click Finish
You should now see your created Failed Request Tracing Rules.
Now go and refresh the browser a couple times to see your error again. Once that is logged then go to the trace logs. To find that location go back to the site in features view, select Failed Request Tracing and select “View Trace Logs…”
Double click to view the recorded log (you can use IE):
Viewing these should at least help to identify the obvious when it is a line in the web.config or when there has been a setting changed as a result of saving a configuration option in SharePoint (or 3rd party products or web parts in SharePoint). Hope this helps, happy troubleshooting. Questions are always welcome.