Wednesday, January 30, 2008

E* HTTPRESPONSE: Error in openSTA

E* HTTPRESPONSE: No data available for connection id(XX),

There are a few different scenarios that cause this error. Each has its own symptom, cause and workaround; these are listed below:

* If you are getting these errors when your script has a LOAD RESPONSE_INFO after a request that could potentially return no content. Then the chances are there is no data available - this might be for a valid reason, HTTP 304 return or the like; or an invalid one, like your Web server dropping the connection or having an error.
cause: There is no returned data available to run the LOAD RESPONSE_INFO on.
workaround: Check the HTTP CODE and STATUS to make sure you've actually got content before calling the LOAD RESPONSE_INFO.
bug: no it isn't!

* If you are getting these errors running a heavy load test and many of your HTTP response times in the log are large.
probable cause: Your Web server is not responding within the timeout period and OpenSTA replay has to timeout its HTTP requests.
workaround: Increase the OpenSTA timeout. Ask yourself if you really want to do this and if any sane user would really want to wait 3 minutes for a Web site to respond.
bug: Your Web application is the problem and not OpenSTA - fix it.

* If you are getting these errors when your script has a LOAD RESPONSE_INFO on a connection that has been re-used for multiple HTTP requests previously (with HTTP Keep-Alive). The HTTP request directly before the failing LOAD RESPONSE_INFO will have a 200 OK HTTP CODE, a STATUS of 0 (success) but a bad BODYSIZE of 0 - it will have silently failed. This will be happening when the time between the previous use of the connection id and the last one has become extended - for whatever reason.
probable cause:If the Web server times out a HTTP connection during replay that didn't timeout during the recording, then your script will attempt to reuse a connection which is dead. Under certain circumstances, reuse of a dead HTTP connection will fail silently (instead of reconnected and retried as intended) meaning the LOAD RESPONSE_INFO commands fail with the above error because there is no returned data available from the failed request ...
workaround: Manually edit the script and make sure that connections that are likely to timeout are manually closed immediately after use using DISCONNECT. The next use of the connection ID will cause the connection to be re-established and avoid the possible timeouts and therefore errors. Be aware that this really is a workaround and not a solution - editing your script in this way means it will not be simulating exactly what the browser did, and therefore may not be a true simulation of actual browser Load.
bug: See end of page. Bug initially logged as bug#433574 now being dealt with in bug#645735. For more in depth info of this specific problem see this thread started by Magnus Lindberg on the UserMailingList.

* If these errors occur when you are using a variable for the connection ID on a LOAD RESPONSE_INFO BODY.
probable cause: I wish I knew.
workaround: Also do a LOAD RESPONSE_INFO HEADER on the same connection variable and request - the bug report contains some other potential workarounds.
bug: See below.

No comments: