Godaddy – Remove 500 Internal Error – Detailed Error On IIS6 and 7 In Windows Hosting

By Anil Gupta, 0  Tech Tips

Remove 500 Internal Error and Show Actual Detailed Error On IIS6 and 7 In Godaddy Windows Hosting

Remove 500 Internal Error and Show Actual Detailed Error On IIS6 and 7 In Godaddy Windows Hosting

By default, Windows hosting servers like Godaddy display a generic error when any .NET application generates an exception because the detailed error messages may allow a malicious user to obtain sensitive information about the website. Most of the time this is a “500 Internal Server Error” like the one shown in image.

The image that you see on Godaddy windows shared or 4G hosting for 500 internal server error is actually hosted on GoDaddy servers and is shown automatically for your website.

To troubleshoot the actual error, you should modify your web.config file and specify that a custom error message is displayed. A custom error message helps you to locate the specific code that is causing the issue.

Displaying Custom Error Messages / Enabling Detailed Errors on IIS 6

You should include the following tags in your web.config:


<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>

Displaying Custom Error Messages / Enabling Detailed Errors on IIS 7

You should include the following tags in your web.config:


<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>

Once you modify your web.config with the above values, the actual error will be shown instead of 500 internal server error and then you can fix your code accordingly.

 

Above additions/modifications to web.config also does not solve the 500 server error?

If the above changes also does not reveal anything and you still get the 500 internal server error, then i would suggest you to thoroughly check your web.config file for some not so obvious error like:

  • Any spelling errors or
  • Any missing opening or closing tags
  • Any incomplete comment tags like comment was opened but not closed
  • A tag repeated multiple times
  • A tag has multiple end tags

Yes, i have faced issues that i have listed above and they certainly block the actual error. It was very frustrating to see the 500 error infinitely and when i had solved them after correcting one of the issues listed above, i could easily understand the meaning of “All complex problems have Easy solutions”.

In almost 99.9% cases of 500 internal server error, the issue was with the web.config itself and was one of the reasons that i have listed above!