Active Server Pages error 'ASP 0113'

J

Justin Doh

"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.
 
D

Dave Anderson

Justin Doh said:
"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?
 
B

Bob Barrows [MVP]

Justin said:
"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>"
....
 
O

Old Pedant

Bob Barrows said:
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.
 
B

Bob Barrows [MVP]

Old said:
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.
 
J

Jeff Dillon

"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
 
D

Dave Anderson

Old Pedant said:
...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.
 
J

Justin Doh

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.
 
O

Old Pedant

Justin Doh said:
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.
 
J

Justin Doh

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.
 
D

Dave Anderson

Justin Doh said:
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.
 
O

Old Pedant

Justin Doh said:
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???
 
O

Old Pedant

Dave Anderson said:
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.
 
J

Justin Doh

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

Thank you!
 
J

Justin Doh

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

Old Pedant

Justin Doh said:
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.
 
O

Old Pedant

Justin Doh said:
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.
 
D

Dave Anderson

Old Pedant said:
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
 
O

Old Pedant

Dave Anderson said:
=====================================================================
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top