0

I'm currently working on a page and I want to be able to view the stack trace so that I can pin point the issue. If you go to http://www.phrd.com/cattorney-bio.asp?AttorneyID=569, you will see that it just gives you the generic HTTP 500 error. I want to be able to see the specific error. I remember it had to do with the web.config file, but I don't remember what setting it was. I only want to do this very temporarily and I will turn it back off. I thought it was turning the customeError setting to false, but there must be something more.

When I have a set of code in my page, it gives me the 500 error. Below is my code:

<%    
    strSQL5 = "SELECT * FROM ADVISORIES WHERE ATTY_ID="& AttorneyID& " AND Category = 'Employee' ORDER BY Date() ASC"
    set r5 = d2.Execute(strSQL5)
    if (r5.EOF = True) and (r5.BOF = True) then

    else
        r5.movefirst
%>

            <br />  <h3><span>Archived Advisories</span></h3>
            <p>
                <i>Employee Testing</i>
            </p>

                <ul id="ul1">

<%
        cnt=0
        while (r5.EOF = false) and (r5.BOF = false)
        cnt=cnt+1
%>

                    <li><a href="~/docs/" & <%= r5("Filename") %>target="_blank"><%= r5("DisplayText") %></a></li>
<%
            r5.movenext
        wend
%>

                </ul>
<%
    end if
%>          

<%

    strSQL6 = "SELECT * FROM ADVISORIES WHERE ATTY_ID="& AttorneyID& " AND Category = 'Wage' ORDER BY PubDate ASC"
    set r5 = d2.Execute(strSQL6)
    if (r5.EOF = True) and (r5.BOF = True) then

    else
        r5.movefirst
%>


            <p>
                <i>Wage and Hour</i>
            </p>

                <ul id="ul2">

<%
        cnt=0
        while (r5.EOF = false) and (r5.BOF = false)
        cnt=cnt+1
%>

                    <li><a href="~/docs/"<% r5("Filename") %>" target="_blank"><% r5("DisplayText") %></a></li>
<%
            r5.movenext
        wend
%>

                </ul>
<%
    end if
%>

And here is my web.config file:

<system.web>
<!-- 
        Set compilation debug="true" to insert debugging 
        symbols into the compiled page. Because this 
        affects performance, set this value to true only 
        during development.
    -->
<trace enabled="true" pageOutput="true" />
<compilation debug="true" targetFramework="4.0">
  <assemblies>
    <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  </assemblies>
</compilation>
<!--
        The <authentication> section enables configuration 
        of the security authentication mode used by 
        ASP.NET to identify an incoming user. 
    -->
<authentication mode="Forms">
  <forms name="FormsAuthentication" path="/" loginUrl="login.aspx" timeout="20" />
</authentication>
<authorization>
  <allow users="*" />
</authorization>
<membership defaultProvider="AccessMembershipProvider">
  <providers>
    <clear />
    <add name="AccessMembershipProvider" type="AccessProvider.AccessMembershipProvider" connectionStringName="UsersDB" />
  </providers>
</membership>
<roleManager enabled="true" defaultProvider="AccessRoleProvider">
  <providers>
    <clear />
    <add name="AccessRoleProvider" type="AccessProvider.AccessRoleProvider" connectionStringName="UsersDB" />
  </providers>
</roleManager>
<customErrors mode="Off" />
user692942
  • 16,398
  • 7
  • 76
  • 175
Joseph
  • 609
  • 2
  • 12
  • 26
  • If I take out this code, the rest of it works just fine. – Joseph Feb 11 '15 at 18:51
  • This looks like Classic ASP, not ASP.NET. What file is this in? something.asp or something.aspx? – John Saunders Feb 11 '15 at 19:30
  • order by Date() in select ? – DimaSUN Feb 11 '15 at 20:48
  • have U created Date() function or is it error ? – DimaSUN Feb 11 '15 at 20:49
  • error in SQL cause 500 error – DimaSUN Feb 11 '15 at 20:50
  • 1
    Do u have assigned 500.100 error handler in IIS ? – DimaSUN Feb 11 '15 at 20:51
  • 1
    @DimaSUN That is the right question all these other answers about Classic ASP being difficult to debug is absolute rubbish! Make sure `Error Pages` is set to `Detailed` in IIS for the Classic ASP Web Site and you are good to go. – user692942 Feb 12 '15 at 09:33
  • @Joseph To help you further it would help to know what Windows version (Professional, Server etc) you are running (vista, 7, 8, Server 2008, Server 2012 etc) and what version of IIS is installed (should be able to work this out from the operating system version though). – user692942 Feb 12 '15 at 09:40
  • @Joseph Also take a look [here](http://stackoverflow.com/a/2765795/692942) how to setup `Detailed` errors in IIS. – user692942 Feb 12 '15 at 09:50
  • Thank you @DimaSUN and @Lankymart! The one thing I had to figure out was where my IIS Manager was installed. It was on a different server than the one that I was working on. Not sure why, but it was. Once I found out how to turn the detailed errors on, it was indeed a SQL error. Thanks guys! – Joseph Feb 15 '15 at 19:20

2 Answers2

1

First of all you are using ASP Classic technology not ASP.NET.

Your best bet is to use Failed Request Tracing rules.

Here is how you turn it on in 3 steps.

I took some screen shot for you:

  1. Select the site in IIS, and click on Failed Request Tracing rules

enter image description here

  1. On the right action pane click on Failed Request Tracing:

enter image description here

  1. Check enable checkbox, and specify the path:

enter image description here

That's it, now navigate to this path, you will find a folder for your site.

Inside of that folder you will see xml file. you can view them in the browser, they use a stylesheet so it is pretty well formatted.

EDIT:

Follow this link if you have trouble :

Using Failed Request Tracing Rules to Troubleshoot Application Request Routing (ARR)

meda
  • 45,103
  • 14
  • 92
  • 122
  • Yeah, I know. Part of the website (the parts that I've done) are in ASP.Net, but this is a page that I did not build. I know IIS is on my server somewhere, but I can't seem to find it. All I find is IIS 6.0 manager and it opens up a window with a direcotry tree on it, showing the web server, and if I expand that, it shows an ftp site and an SMPT Virtual Server. DOes that even make sense? – Joseph Feb 11 '15 at 19:52
  • @Joseph that is the wrong IIS, search in start menu for IIS, if the second is not listed, then IIS is not installed – meda Feb 11 '15 at 19:53
  • I clicked on start and even searched from the start menu and it only came up with the IIS 6.0 Manager... – Joseph Feb 11 '15 at 19:53
  • @Joseph you need to install that role – meda Feb 11 '15 at 19:54
  • Okay, so it sounds like I need to install it? – Joseph Feb 11 '15 at 19:54
  • Okay, I will look into it. – Joseph Feb 11 '15 at 19:54
  • Go to server manager and install IIS Web Server, by default they are all disabled – meda Feb 11 '15 at 19:56
  • So, I looked at the server manager and the "Web Server (IIS)" role is installed.... I clicked on the role and it took me to an event viewer that filtered for those type of events specifically and also told me which Role services were installed. – Joseph Feb 11 '15 at 19:59
  • now you should be able to trace error logs, are you able to? – meda Feb 11 '15 at 20:02
  • I looked in the event viewer, but I don't think that's what you are talking about. I went to the inetpub/logs/FailedReqsFolder folder and nothing was there. – Joseph Feb 11 '15 at 20:08
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/70737/discussion-between-ahmed-daou-and-joseph). – meda Feb 11 '15 at 20:17
  • Don't agree Classic ASP is painful to debug, I debug it everyday! With `Detailed` errors enabled in IIS 7+ or setting up the `IISHelp` virtual folder and enabling the `500-100.asp` you can get the exact line that triggered the error. – user692942 Feb 12 '15 at 09:53
  • @Lankymart you must be a classic asp fan to say that, I removed offending sentence ;) – meda Feb 12 '15 at 17:15
  • @AhmedDaou Not at all I work in both, unfortunately legacy projects still have to be supported. – user692942 Feb 12 '15 at 17:26
  • @Lankymart but you have to atleast admit that debugging asp classic is more tedious – meda Feb 12 '15 at 17:28
  • @AhmedDaou It really depends on the setup. Request traces in my opinion can be annoying especially if configured wrong. – user692942 Feb 12 '15 at 17:30
-1

In visual studio go to properties and select build and in configuration section select debug from drop-down

Or alternative in web.config set debug=true in compilation tag Eg

<compilation debug="true" targetFramework="4.5">
  • In the web.config file? Sorry, the answer seems a little generic. Where is "properties"? – Joseph Feb 11 '15 at 18:20
  • When I go to Properties, I can select "Build" but I can't see anything that says "configuration." Also, I have set debug to true as well, and no dice. – Joseph Feb 11 '15 at 19:36