[selenium-users] Internal Server Error

123 views
Skip to first unread message

annlee

unread,
May 24, 2010, 5:34:58 AM5/24/10
to Selenium Users
Dear all,

Hope I can find an answer here. I'm using latest Selenium Grid 1.0.6
with Testng framework.

I'm automating a user journey by feeding content from text files to
the same selenium script (in Java), so it is a repeated test with
different test data. Say if I have 50 text files, then there will be
50 test runs using the same selenium script, and they run
sequentially. However, I bumped into this problem where the test
stopped arbitrary and giving me Internal Server Error. Arbitrary in
the sense say it stopped at test no. 30, and in the next attempt it
stopped at test no. 12, so on and so forth which leaves me no clue
what the problem is.

Does anyone has similar problem here? Hope someone could shed the
light on this...

Thanks.

Ann

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Andrew

unread,
May 24, 2010, 11:35:36 AM5/24/10
to Selenium Users
Things I've seen cause this include a malformed URL in the test script
or the selenium server (RC) shut down. I don't know if these might
solve your problem.

annlee

unread,
May 24, 2010, 1:01:37 PM5/24/10
to Selenium Users
Hi Andrew,

First, thanks for responding.

On each attempt, the 50 test runs I mentioned earlier were using the
same URL over and over again, so if it's the URL malformed problem, I
would have thought it wouldn't run at all in the beginning. The
problem being of the 50 test runs, it stopped arbitrary, sometimes it
completed the 50 test runs and sometimes it didn't leaving the RC
stuck in active state and browser (tried on safari and firefox)
remained open. I will then have to quit them manually.

I thought it may have to do with java heap size thus I increased it to
256M (default 125M), but it does not help.

While trying it out more times, I now get to see other errors related
to selenium sessions:

<pre>
java.lang.RuntimeException: Could not start Selenium session: ERROR:
Could not retrieve a new session
at
com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:
89)
at
com.thoughtworks.selenium.grid.tools.ThreadSafeSeleniumSessionStorage.startSeleniumSession(ThreadSafeSeleniumSessionStorage.java:
26)
at
com.phorm.selenium.oix.discover.DiscoverAutomatorTextBased.runDiscoverAutomationTextBased(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
</pre>


Ann

Ayhan

unread,
May 24, 2010, 3:36:19 PM5/24/10
to Selenium Users
Hi Ann,

when this problem occurs, check the memory (Windows Task Manager -->
Applications --> the_browser_in_use). Most probably you will see that
it is very high (close to 700 Mb of RAM) and this might cause the
Internal Server Error (A clumsy way of saying "Unable to load
browser"). Let me know if this is the case, I might offer a few tips
to prevent it.

Ayhan Tek

Ann Jee Lee

unread,
May 25, 2010, 8:57:34 AM5/25/10
to seleniu...@googlegroups.com
Hi Ayhan,

Thank for helping.

I noticed the memory used for Hud, RC, and browsers were never above 110M and so now I rule out the memory problem guess I made earlier.

Having said that, this problem still remained. However, I noticed whenever this problem happened, no error log seen on Selenium RC nor the console where I run my test, but when I traced back the Hub log, I did see the following two types of error appeared on the Selenium Hub log:

Error 1:

    [java] WARNING: SimpleHttpConnectionManager being used incorrectly.  Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.
     [java] May 25, 2010 12:29:29 PM com.thoughtworks.selenium.grid.hub.HubServlet forward
     [java] INFO: Responding with 200 / OK
     [java] May 25, 2010 12:29:29 PM com.thoughtworks.selenium.grid.hub.HubServlet forward
     [java] INFO: Processing '1 => "kwmToolForm_source1", cmd => "click", sessionId => "6f6e48b983b9416dbcf40a5a543a59a2"'
     [java] May 25, 2010 12:29:29 PM com.thoughtworks.selenium.grid.hub.HubServlet forward
     [java] INFO: Responding with 403 / <html>
     [java] <head>
     [java] <title>Error 403 Forbidden for Proxy</title>
     [java] </head>
     [java] <body>
     [java] <h2>HTTP ERROR: 403</h2><pre>Forbidden for Proxy</pre>...[1140 characters truncated]
     [java] May 25, 2010 12:29:29 PM com.thoughtworks.selenium.grid.hub.HubServlet forward


The following two lines caught my attention,

 [java] WARNING: SimpleHttpConnectionManager being used incorrectly.  Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.


[java] WARNING: Remote Control at 10.44.46.128:5000 is unresponsive


Error 2:

   [java] May 25, 2010 11:03:18 AM org.apache.commons.httpclient.SimpleHttpConnectionManager getConnectionWithTimeout
     [java] WARNING: SimpleHttpConnectionManager being used incorrectly.  Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.
     [java] May 25, 2010 11:04:18 AM org.apache.commons.httpclient.HttpMethodBase readResponseBody
     [java] INFO: Response content length is not known
     [java] May 25, 2010 11:04:18 AM org.apache.commons.httpclient.HttpMethodBase getResponseBody
     [java] WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
     [java] May 25, 2010 11:04:18 AM com.thoughtworks.selenium.grid.hub.remotecontrol.RemoteControlProxy unreliable
     [java] WARNING: Remote Control at 10.44.46.128:5000 is unresponsive
     [java] May 25, 2010 11:04:18 AM com.thoughtworks.selenium.grid.hub.remotecontrol.GlobalRemoteControlPool unregisterRemoteControlIfUnreliable
     [java] WARNING: Unregistering unreliable RC [RemoteControlProxy 10.44.46.128:5000#true]
     [java] 2010-05-25 11:04:18.120::WARN:  /selenium-server/driver/
     [java] java.io.IOException: Attempted read on closed stream.
     [java]     at org.apache.commons.httpclient.AutoCloseInputStream.isReadAllowed(AutoCloseInputStream.java:165)
     [java]     at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:125)
     [java]     at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMethodBase.java:684)
     [java]     at com.thoughtworks.selenium.grid.HttpClient.request(HttpClient.java:55)
     [java]     at com.thoughtworks.selenium.grid.HttpClient.post(HttpClient.java:35)
     [java]     at com.thoughtworks.selenium.grid.hub.remotecontrol.RemoteControlProxy.forward(RemoteControlProxy.java:65)
     [java]     at com.thoughtworks.selenium.grid.hub.remotecontrol.commands.SeleneseCommand.execute(SeleneseCommand.java:40)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.forward(HubServlet.java:52)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.process(HubServlet.java:41)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.doPost(HubServlet.java:31)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     [java]     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
     [java]     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
     [java]     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
     [java]     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
     [java]     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
     [java]     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
     [java]     at org.mortbay.jetty.Server.handle(Server.java:303)
     [java]     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
     [java]     at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735)
     [java]     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636)
     [java]     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
     [java]     at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
     [java]     at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
     [java]     at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
     [java] May 25, 2010 11:04:19 AM com.thoughtworks.selenium.grid.hub.HubServlet forward
     [java] INFO: Processing '1 => "Keywords Mining Tool - Results", cmd => "isTextPresent", sessionId => "7001c54a9b95481ea6a592bc77a1cb4c"'
     [java] 2010-05-25 11:04:19.170::WARN:  /selenium-server/driver/:
     [java] java.lang.NullPointerException
     [java]     at com.thoughtworks.selenium.grid.hub.remotecontrol.GlobalRemoteControlPool.updateSessionLastActiveAt(GlobalRemoteControlPool.java:212)
     [java]     at com.thoughtworks.selenium.grid.hub.remotecontrol.commands.SeleneseCommand.execute(SeleneseCommand.java:39)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.forward(HubServlet.java:52)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.process(HubServlet.java:41)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.doPost(HubServlet.java:31)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     [java]     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
     [java]     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
     [java]     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
     [java]     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
     [java]     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
     [java]     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
     [java]     at org.mortbay.jetty.Server.handle(Server.java:303)
     [java]     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
     [java]     at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735)
     [java]     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636)
     [java]     at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)

Ann Jee Lee

unread,
May 25, 2010, 9:12:19 AM5/25/10
to seleniu...@googlegroups.com
More error log:


    [java] WARNING: Remote Control at 10.44.46.128:5000 is unresponsive
     [java] May 25, 2010 2:09:00 PM com.thoughtworks.selenium.grid.hub.remotecontrol.GlobalRemoteControlPool unregisterRemoteControlIfUnreliable

     [java] WARNING: Unregistering unreliable RC [RemoteControlProxy 10.44.46.128:5000#true]
     [java] May 25, 2010 2:09:00 PM com.thoughtworks.selenium.grid.hub.remotecontrol.GlobalRemoteControlPool releaseForSession
     [java] INFO: Releasing pool for session id='aa33ac2543f54e249cb96cffa9c19698'
     [java] 2010-05-25 14:09:00.543::WARN:  /selenium-server/driver/:
     [java] java.lang.NullPointerException
     [java]     at com.thoughtworks.selenium.grid.hub.remotecontrol.GlobalRemoteControlPool.releaseForSession(GlobalRemoteControlPool.java:115)
     [java]     at com.thoughtworks.selenium.grid.hub.remotecontrol.commands.TestCompleteCommand.execute(TestCompleteCommand.java:23)

     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.forward(HubServlet.java:52)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.process(HubServlet.java:41)
     [java]     at com.thoughtworks.selenium.grid.hub.HubServlet.doPost(HubServlet.java:31)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
     [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     [java]     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
     [java]     at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
     [java]     at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
     [java]     at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
     [java]     at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
     [java]     at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
     [java]     at org.mortbay.jetty.Server.handle(Server.java:303)
     [java]     at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
     [java]     at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735)


Ayhan

unread,
May 25, 2010, 11:03:57 AM5/25/10
to Selenium Users
Hi Ann,
Make sure that you do not have a similar problem with stop() method
mentioned in the following post:
http://groups.google.com/group/selenium-users/browse_thread/thread/39a84102b18bdf61/083998f262712a2c?#083998f262712a2c

Ayhan
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages