Active Server Pages error 'ASP 0113'

Discussion in 'ASP General' started by Justin Doh, Sep 11, 2008.

  1. Justin Doh

    Justin Doh Guest

    "Active Server Pages error 'ASP 0113'
    Script timed out"

    I am still getting this error, and I am not sure how I could fix this.

    When I execute the query at SQL 2005, it only takes 8 seconds.
    The stored procedure for this report has been already went through Database
    Engine Tuning Advisor to put all the necessary indexes on the associated
    tables.

    It happens when I run this report on other new web server.

    I already put this on the ASP web page for this report.

    <% server.ScriptTimeout = 4000 %>

    ..ConnectionTimeout = 4800
    ..CommandTimeout = 4800

    Any idea?
    Thanks.
     
    Justin Doh, Sep 11, 2008
    #1
    1. Advertising

  2. "Justin Doh" wrote:
    > "Active Server Pages error 'ASP 0113'
    > Script timed out"
    >
    > ...<% server.ScriptTimeout = 4000 %>...
    >
    > .ConnectionTimeout = 4800
    > .CommandTimeout = 4800
    >
    > Any idea?


    Maybe it's not database-related. Are you in an endless loop, perhaps missing
    a MoveNext() or something?



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
     
    Dave Anderson, Sep 11, 2008
    #2
    1. Advertising

  3. Justin Doh wrote:
    > "Active Server Pages error 'ASP 0113'
    > Script timed out"
    >
    > I am still getting this error, and I am not sure how I could fix this.
    >
    > When I execute the query at SQL 2005, it only takes 8 seconds.
    > The stored procedure for this report has been already went through
    > Database Engine Tuning Advisor to put all the necessary indexes on
    > the associated tables.
    >
    > It happens when I run this report on other new web server.
    >
    > I already put this on the ASP web page for this report.
    >
    > <% server.ScriptTimeout = 4000 %>
    >
    > .ConnectionTimeout = 4800
    > .CommandTimeout = 4800
    >
    > Any idea?
    > Thanks.


    Before setting ridiculous timeouts, verify that you need them.
    1. use SQL Profiler to run a trace to verify that the stored procedure
    is the problem
    2. identify the bottleneck in your code if the stored procedure is not
    the problem

    <%
    Response.Write "Code start: " & now & "<BR>"
    ....
    Response.Write "Opening connection: " & now & "<BR>"
    ....
    Response.Write "Calling procedure: " & now & "<BR>"

    ....
    Response.Write "Processing results: " & now & "<BR>"
    ....


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Sep 11, 2008
    #3
  4. Justin Doh

    Old Pedant Guest

    "Bob Barrows [MVP]" wrote:

    > Before setting ridiculous timeouts, verify that you need them.
    > 1. use SQL Profiler to run a trace to verify that the stored procedure
    > is the problem
    > 2. identify the bottleneck in your code if the stored procedure is not
    > the problem
    >
    > <%
    > Response.Write "Code start: " & now & "<BR>"
    > ....
    > Response.Write "Opening connection: " & now & "<BR>"
    > ....
    > Response.Write "Calling procedure: " & now & "<BR>"
    >
    > ....
    > Response.Write "Processing results: " & now & "<BR>"
    > ....


    But if the problem is an infinite loop of some kind, then you might want to
    follow up each of the Response.Write calls with
    Response.Flush
    to be sure the output gets to the browser. Also, be sure to *NOT* output
    your debug into the <TR> rows of a <TABLE>. Even with Response.Flush, the
    browser will set there forever waiting for the terminating </TABLE> before
    displaying anything.
     
    Old Pedant, Sep 11, 2008
    #4
  5. Old Pedant wrote:
    > "Bob Barrows [MVP]" wrote:
    >
    >> Before setting ridiculous timeouts, verify that you need them.
    >> 1. use SQL Profiler to run a trace to verify that the stored
    >> procedure is the problem
    >> 2. identify the bottleneck in your code if the stored procedure is
    >> not the problem
    >>
    >> <%
    >> Response.Write "Code start: " & now & "<BR>"
    >> ....
    >> Response.Write "Opening connection: " & now & "<BR>"
    >> ....
    >> Response.Write "Calling procedure: " & now & "<BR>"
    >>
    >> ....
    >> Response.Write "Processing results: " & now & "<BR>"
    >> ....

    >
    > But if the problem is an infinite loop of some kind, then you might
    > want to follow up each of the Response.Write calls with
    > Response.Flush
    > to be sure the output gets to the browser.


    I did mean to put that in - sorry

    > Also, be sure to *NOT*
    > output your debug into the <TR> rows of a <TABLE>. Even with
    > Response.Flush, the browser will set there forever waiting for the
    > terminating </TABLE> before displaying anything.


    I didn't think that needed to be said, but thanks for saying it.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Sep 11, 2008
    #5
  6. Justin Doh

    Jeff Dillon Guest

    > "Active Server Pages error 'ASP 0113'
    > Script timed out"
    >
    > I am still getting this error, and I am not sure how I could fix this.
    >


    Try with a very simple query first to verify connectivity, etc.

    Jeff
     
    Jeff Dillon, Sep 11, 2008
    #6
  7. "Old Pedant" wrote:
    > ...Also, be sure to *NOT* output your debug into the <TR> rows of a
    > <TABLE>. Even with Response.Flush, the browser will set there forever
    > waiting for the terminating </TABLE> before displaying anything.


    It has been years since I saw a browser other than Internet Explorer that
    exhibits this behavior. Certainly both Firefox and Opera will display table
    rows before </table> is reached.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
     
    Dave Anderson, Sep 11, 2008
    #7
  8. Justin Doh

    Justin Doh Guest

    Thank you very much for the feedback.

    My output is:
    I have the error message on the top of web page

    Active Server Pages error 'ASP 0113'
    Script timed out

    And then, there is output (report with data)..

    It retrieved the data fine, but why do I have the error message on the top?

    Thanks.



    "Jeff Dillon" wrote:

    > > "Active Server Pages error 'ASP 0113'
    > > Script timed out"
    > >
    > > I am still getting this error, and I am not sure how I could fix this.
    > >

    >
    > Try with a very simple query first to verify connectivity, etc.
    >
    > Jeff
    >
    >
    >
     
    Justin Doh, Sep 11, 2008
    #8
  9. Justin Doh

    Old Pedant Guest

    "Justin Doh" wrote:

    > My output is:
    > I have the error message on the top of web page
    >
    > Active Server Pages error 'ASP 0113'
    > Script timed out
    > And then, there is output (report with data)..
    >
    > It retrieved the data fine, but why do I have the error message on the top?


    Well, this is a pure guess. But one way it *could* happen would be for you
    to have an infinite loop AFTER all of the reporting is done but before the
    final </TABLE> tag was written.

    And if your reporting is done into a <TABLE> then the error message, since
    it wouldn't be output with <TR><TD>...</TD></TR> surrounding it, then indeed
    the browser might show the error message *before* the incomplete <TABLE>.

    As Dave Anderson might comment, this would likely only happen with MSIE (and
    possibly only with pre-MSIE 7 versions), but I have seen it happen with MSIE
    6, for sure. (Well, not timeout...but other errors.)

    You can find out the truth of my guess by inspecting the HTML. Do a
    VIEW==>>SOURCE in the browser and look at the HTML (in Notepad, if using
    MSIE, by default). See if the error message really is at the bottom of the
    HTML text and is simply displaying at the top becuz of MSIE peculiarities.
     
    Old Pedant, Sep 11, 2008
    #9
  10. Justin Doh

    Justin Doh Guest

    You know what.
    When I looked at the SOURCE of HTML (notepad), I see the error message on
    the bottom.
    How do I fix this?
    Thanks.

    "Old Pedant" wrote:

    >
    > "Justin Doh" wrote:
    >
    > > My output is:
    > > I have the error message on the top of web page
    > >
    > > Active Server Pages error 'ASP 0113'
    > > Script timed out
    > > And then, there is output (report with data)..
    > >
    > > It retrieved the data fine, but why do I have the error message on the top?

    >
    > Well, this is a pure guess. But one way it *could* happen would be for you
    > to have an infinite loop AFTER all of the reporting is done but before the
    > final </TABLE> tag was written.
    >
    > And if your reporting is done into a <TABLE> then the error message, since
    > it wouldn't be output with <TR><TD>...</TD></TR> surrounding it, then indeed
    > the browser might show the error message *before* the incomplete <TABLE>.
    >
    > As Dave Anderson might comment, this would likely only happen with MSIE (and
    > possibly only with pre-MSIE 7 versions), but I have seen it happen with MSIE
    > 6, for sure. (Well, not timeout...but other errors.)
    >
    > You can find out the truth of my guess by inspecting the HTML. Do a
    > VIEW==>>SOURCE in the browser and look at the HTML (in Notepad, if using
    > MSIE, by default). See if the error message really is at the bottom of the
    > HTML text and is simply displaying at the top becuz of MSIE peculiarities.
    >
    >
     
    Justin Doh, Sep 11, 2008
    #10
  11. "Justin Doh" wrote:
    > You know what.
    > When I looked at the SOURCE of HTML (notepad), I see the error message on
    > the bottom.
    > How do I fix this?


    Fix what? That the error message is at the bottom?

    If I were trying to find the moment this timeout occurs, I would put a
    Response.Flush() after every Response.Write(), and load the whole thing in
    Firefox, watching to see the timing of the page as it progresses toward the
    error. Is it all loading quickly, then doing nothing for a while, or do the
    rows load at a constant pace until the error?

    For IE-specific troubleshooting, you could also insert a </table><table>
    every few rows in order to force rendering.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
     
    Dave Anderson, Sep 11, 2008
    #11
  12. Justin Doh

    Old Pedant Guest

    "Justin Doh" wrote:

    > You know what.
    > When I looked at the SOURCE of HTML (notepad), I see the error message on
    > the bottom.
    > How do I fix this?


    So now you have to find out what is going into an infinite loop after all
    the data has been reported.

    At this point, I don't think we can help you until/unless you show some
    source code.

    We know that the problem occurs after the last </TR> is written, or you
    wouldn't see *all* of the data.

    We also know the problem occurs before the </TABLE> is written, or the error
    message would appear after the table in the browser.

    SO... What ASP code occurs between those two points in time in your code???
     
    Old Pedant, Sep 11, 2008
    #12
  13. Justin Doh

    Old Pedant Guest

    "Dave Anderson" wrote:

    > If I were trying to find the moment this timeout occurs, I would put a
    > Response.Flush() after every Response.Write(), ...


    But I think that the problem is occurring at a point in time when he isn't
    *doing* any Response.Write calls. Possibly even when he is trying to close
    the connection. It would be silly, but if he had something like:
    While Err.Number > 0
    DB.Close
    Wend
    and if "DB" was already closed at that point...well, kablooey!

    So I really think we have to see some code.
     
    Old Pedant, Sep 11, 2008
    #13
  14. Justin Doh

    Justin Doh Guest

    I found the reason.
    I had the "response.flush" but I did not have "response.buffer = true" before.

    Thank you!

    "Old Pedant" wrote:

    >
    >
    > "Dave Anderson" wrote:
    >
    > > If I were trying to find the moment this timeout occurs, I would put a
    > > Response.Flush() after every Response.Write(), ...

    >
    > But I think that the problem is occurring at a point in time when he isn't
    > *doing* any Response.Write calls. Possibly even when he is trying to close
    > the connection. It would be silly, but if he had something like:
    > While Err.Number > 0
    > DB.Close
    > Wend
    > and if "DB" was already closed at that point...well, kablooey!
    >
    > So I really think we have to see some code.
    >
     
    Justin Doh, Sep 12, 2008
    #14
  15. Justin Doh

    Justin Doh Guest

    Oops. I am still getting error.
    The error disappeared and then now it appears again.
    I got to dig again..

    "Justin Doh" wrote:

    > I found the reason.
    > I had the "response.flush" but I did not have "response.buffer = true" before.
    >
    > Thank you!
    >
    > "Old Pedant" wrote:
    >
    > >
    > >
    > > "Dave Anderson" wrote:
    > >
    > > > If I were trying to find the moment this timeout occurs, I would put a
    > > > Response.Flush() after every Response.Write(), ...

    > >
    > > But I think that the problem is occurring at a point in time when he isn't
    > > *doing* any Response.Write calls. Possibly even when he is trying to close
    > > the connection. It would be silly, but if he had something like:
    > > While Err.Number > 0
    > > DB.Close
    > > Wend
    > > and if "DB" was already closed at that point...well, kablooey!
    > >
    > > So I really think we have to see some code.
    > >
     
    Justin Doh, Sep 12, 2008
    #15
  16. Justin Doh

    Old Pedant Guest

    "Justin Doh" wrote:

    > I found the reason.
    > I had the "response.flush" but I did not have "response.buffer = true" before.


    This has *NOTHING* to do with the cause of the error. This only has to do
    with what the Response.Write's are showing you. The debug info. Not the
    cause of the orginal problem.
     
    Old Pedant, Sep 12, 2008
    #16
  17. Justin Doh

    Old Pedant Guest

    "Justin Doh" wrote:

    > I found the reason.
    > I had the "response.flush" but I did not have "response.buffer = true" before.


    Response.Buffer=True is the *default* for all modern versions (since 2003 at
    least, maybe before that) of IIS. So I doubt that you actually changed
    anything.
     
    Old Pedant, Sep 12, 2008
    #17
  18. "Old Pedant" wrote:
    > Response.Buffer=True is the *default* for all modern versions (since
    > 2003 at least, maybe before that) of IIS.


    Value Description
    =====================================================================
    FALSE No buffering. The server sends output to the client as it is
    processed. This is the default value for versions of IIS 4.0
    and earlier. For version 5.0 and later, the default value is
    TRUE.

    http://msdn.microsoft.com/en-us/library/ms526001.aspx



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
     
    Dave Anderson, Sep 12, 2008
    #18
  19. Justin Doh

    Old Pedant Guest

    "Dave Anderson" wrote:

    > "Old Pedant" wrote:
    > > Response.Buffer=True is the *default* for all modern versions (since
    > > 2003 at least, maybe before that) of IIS.

    >

    =====================================================================
    > FALSE No buffering. The server sends output to the client as it is
    > processed. This is the default value for versions of IIS 4.0
    > and earlier. For version 5.0 and later, the default value is
    > TRUE.
    > http://msdn.microsoft.com/en-us/library/ms526001.aspx


    Yes, and this page
    http://support.microsoft.com/kb/224609
    says IIS 5 shipped with Windows 2000. So my "maybe before" was more than
    true. It would be pretty surprising to find a shop still running IIS 4,
    today. They'd presumably still be running WindowsNT version 4.

    Or were you agreeing with me? Hmmm...I guess you were. Okay. Great.
     
    Old Pedant, Sep 12, 2008
    #19
  20. "Old Pedant" "wrote":
    >> http://msdn.microsoft.com/en-us/library/ms526001.aspx

    >
    > [snip]
    >
    > Or were you agreeing with me? Hmmm...I guess you were. Okay.
    > Great.


    Documentation takes no sides.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms.
     
    Dave Anderson, Sep 12, 2008
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. carlos seramos
    Replies:
    2
    Views:
    489
    carlos seramos
    Aug 1, 2003
  2. Usama Zulfiqar

    ASP 0113 Error "Time Out"

    Usama Zulfiqar, Jun 17, 2006, in forum: ASP General
    Replies:
    2
    Views:
    133
    Usama Zulfiqar
    Jun 18, 2006
  3. Replies:
    1
    Views:
    116
    Bob Barrows [MVP]
    Jun 28, 2006
  4. george
    Replies:
    0
    Views:
    137
    george
    Sep 12, 2006
  5. Justin Doh
    Replies:
    3
    Views:
    973
    Bob Barrows [MVP]
    Sep 29, 2008
Loading...

Share This Page