How to Get More Detailed Errors from IIS

On the new version of WebSitePanel, you can easily do this through the control panel! Click HERE to find out how!

Related documents:

  1. Error Reading Web Site Information – WebSitePanel or DotNetPanel

Say you work on your website on whatever language that may be, for this example, I’ll use ASP.

Then you encounter an error message, for this example, say the dreaded 500 – Internal server error (picture 1).

picture 1

picture 1

So you sit there thinking “Ok, thanks! That doesn’t give me a clue on what my problem is!

Lets fix that, shell we?

Edit your web.config file, inside the <system.webServer> section put this line in:
<httpErrors errorMode=”Detailed” />

See (picture 2) for an example.

picture 2

picture 2

IMPORTANT: If you are using ASP .NET, you also need to add the following inside the <system.web> tags of your web.config (at the end of the tag). If there is no <system.web>, simply create a starting and ending tag before <system.webserver> like so:

<system.web>
<customErrors defaultRedirect=”errors.aspx” mode=”Off” />
</system.web>

IMPORTANT: If you are using ASP, you may need to turn on errors being sent to the browser. This is done by adding the following tag right before the end system.web tag.

<system.web>
<asp scriptErrorSentToBrowser=”true” />
</system.web>
 

Now we that in place and saved, try to browse your website and in my case, this is what I now saw:

500_internal_server_error_detailed_error

picture 3

Ok! Now I know that I forgot my include file … how silly of me!

FYI, that code was bound to break on purpose, since I didn’t really have those includes… this code was just for the purpose of this demonstration and is noted for you, below:

<%@ Language=VBScript %>
<% Option Explicit %>
<!– #include virtual = “/adovbs.inc” –>
<!– #include virtual = “/conn.asp” –>

<!doctype html public “-//w3c//dtd html 3.2//en”>

<html>

<head>
<title>(Type a title for your page here)</title>
</head>

<body bgcolor=”#ffffff” text=”#000000″ link=”#0000ff” vlink=”#800080″ alink=”#ff0000″>

<%
Dim conn,R,SQL,RecsAffected

Set conn=Server.CreateObject(“ADODB.Connection”)
conn.Mode=adModeReadWrite
conn.ConnectionString = aConnectionString
conn.Open

Tags: , , , , , , , , , | Posted under ASP .NET 2, DotNet/Windows Hosting, Programming/Coding | RSS 2.0

19 Comments on How to Get More Detailed Errors from IIS

  1. Wallpapers says:

    Great Information ! Now I can found the error

  2. Pingback: Trying to run a Perl script on Windows hosting | Arvixe Blog

  3. Pingback: WebSitePanel or DotNetPanel – Error reading web site information | Arvixe Blog

  4. Pingback: Error reading web site information – WebSitePanel or DotNetPanel | Arvixe Blog

  5. OM says:

    The suggestion : won’t work if you just copy+Paste from this blog.
    Note carefull the quotations around ”Detailed”. They are not recognized by web.config.
    So it should be:
    Same applies to:

  6. OM says:

    ok the parse ate some portion of my comments.
    So it should be: “Detailed” — note the quotations has changed.
    Same applies to customErrors suggestion as well.

  7. Andy says:

    How to get detailed error information when custom error 404 is turned on.
    The error I am trying to get detailed information from happens inside the custom error 404 page. I need custom 404 turned on, and error 500 details. I have coded my own asp error 500 page, but you have the “linenumber calculation” turned off so all I get is a column and no error codes

  8. Andy says:

    figured it out myself.

    set the error 404 to execute /404.asp
    set the error 500 to execute /500.asp

    Place this code in the 500.asp file

    place this code in the 404.asp

    visit a missing url on your site eg. http://site.com/nothinghere/

    you will see the detailed error like so;
    Microsoft VBScript compilation error ‘800a0409′

    Unterminated string constant

    /default.asp, line 3

    b = “

  9. Andy says:

    the last port deleted the code…

    500.asp code;
    !–include virtual=’/400.asp’–

    400.asp code;

    a = “1”
    b = “1”
    b = ” ‘ missing quote

    cheers!

  10. Michael E says:

    ok, tried all that and it didn’t work. what am i missing?

    this is the code after applying the suggestions….

    next question … exactly why am i having to do all this code/hacker stuff in the first place? didn’t i hire Arvixe to do this stuff for me?

    • Please contact support .at. arvixe.com or start a live chat or a phone call so we can look into it.

      Arvixe is a web hosting company. Our job is to make sure that your server stays up and your sites load fast. You are responsible for building the website and troubleshooting issues in specific to the code.

    • You’ve hired us to manage a server for you and keep up the services that surround your web presence (web, mail, ftp, etc.). We are not web developers nor web designers. Attempting to troubleshoot an ASP .NET website requires basic level of troubleshooting which you should be familiar with you (and this article attempts to familiarize you with a portion of that). You may also wish to hire a web developer to do this for you as well.

      If this is not working. You can contact our staff who will do this for you so you can see what you may have done incorrectly.

  11. zaq says:

    all that is great if your an experienced web publisher and looking to reverse engineer whats wrong. when your starting from a blank directory and trying to build a site, it doesnt make sense. uploading a basic “hello world” INDEX.HTML file should work. I don’t really care whats wrong, i just want it to work.

    • Hello, you are correct. Simply remove everything inside your wwwroot directory (including the web.config) and upload a index.html with the words hello world in it and it will work just fine. If it doesn’t please contact support.

    • Please go inside your wwwroot. Remove the web.config. Upload a index.html . It will work. This is if you are coding in asp /asp .net and need to see the errors. It is something ever developer needs to know.

  12. SEO says:

    Good Information. Got the error now

  13. BH says:

    Does anyone know how to set this in Coldfusion? I am only getting the “500 – Internal server error” on some of my pages. If I add the to the web.config file, I get the error on all of my pages. I checked the log file, and it was empty.

    The article at: http://www.coldfusionmuse.com/index.cfm/2011/1/6/IIS7.Web.config was not much help, unless I missed something in it

  14. MD IRSHAD says:

    While i am creating a DATABASE or USER then I am getting This message

    The operation you requested has failed to complete.
    We apologize for the inconvenience but your request could not be completed at this time. Please contact us on that matter and our support team will do its best to resolve the issue as soon as possible.

    Thank you for your cooperation.

Leave a Reply

Your email address will not be published. Required fields are marked *


− 1 = 4

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>