Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Remote driver & Firefox: Unable to bind to locking port 7054 within 45000 ms #7272

Closed
lukeis opened this issue Mar 4, 2016 · 38 comments
Closed

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 7272

Hi All,

I'm experiencing some sporadic issues with Remote WebDriver and FF. Sometimes the driver
will hang and all the following requests to create a new session will return with :

Message: Unable to bind to locking port 7054 within 45000 ms Build info: version: '2.41.0',
revision: '3192d8a', time: '2014-03-27 17:17:32' System info: host: 'selenium', ip:
'172.24.44.8', os.name: 'Windows 7', os.arch: 'x86',...

Unfortunately I don't have exact steps to reproduce the issue but it happens every
day.
Environment is :
Selenium Node: Windows7, Firefox 27.0.1, selenium-server-standalone-2.41.0.jar, the
selenium's java process runs inside a service wrapper (http://wrapper.tanukisoftware.com/)
Selenium Grid: Linux, selenium-server-standalone-2.41.0.jar (hub mode)

What I see when the bug occurs is that there are no session according to the console
at /wd/hub/static/resource/hub.html, there is a single Firefox process running but
without a visible window.
What I did further is to monitor the machine with jconsole and saw that there were
~ 400 waiting threads titled "session ......". And from them I pulled up the stack
trace. I found that there were only 3 types of stack traces and I'm attaching those
to the issue.

Do you think you can get something meaningful out of those stack traces to pin point
the problem or at least to think of some workaround.


Reported by ivanlvasilev on 2014-04-29 07:45:36


- _Attachment: [trace1.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-7272/comment-0/trace1.txt)_ - _Attachment: [trace2.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-7272/comment-0/trace2.txt)_ - _Attachment: [trace3.txt](https://storage.googleapis.com/google-code-attachments/selenium/issue-7272/comment-0/trace3.txt)_
@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

How frequently do you start new sessions?

Reported by barancev on 2014-04-29 10:24:42

  • Status changed: NeedsClarification
  • Labels added: Component-Grid

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I can't say exactly but during the busiest period in the log I see ~ 600 requests for
new session during 16 hours period which makes ~ 0.6 new sessions / minute or a new
session is being created every 1.5 minute

Reported by ivanlvasilev on 2014-04-29 11:13:40

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I see the same exact issue where there is a Firefox process running on the grid node,
but not visible window.  I haven't debugged it much, but I am willing to provide any
debug information necessary.  

How would I go about checking the number of new sessions on a node?  Are the FirefoxWebDriver
logs saved somewhere, or is the console my only hope?

Reported by avidgamer123 on 2014-04-29 20:06:20

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

On my nodes the selenium.log is on /var/log/selenium.log I have not this set in configuration
so this must be a default.

Reported by jimusbobus on 2014-05-06 08:31:52

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I have knocked up the following little test which regularly produces the above error
message.

Once the test pauses run 'killall firefox' on your node and the test will continue.

Is anything else needed?

Reported by jimusbobus on 2014-05-08 16:15:10


- _Attachment: [GoogleSearchTest.java](https://storage.googleapis.com/google-code-attachments/selenium/issue-7272/comment-6/GoogleSearchTest.java)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

oops also forgot to mention i am using firefox 29 and selenium 2.41.0.

Reported by jimusbobus on 2014-05-08 16:19:08

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Thanks Jim. Just run the code you provided and after few runs reproduced the problem.
I just added the parallel thread count to be 5.
I was asked to start Firefox in safe mode and after I clicked the whole test got stuck.
Some debugging info from JConsole:

Name: Session 80f511cf-ac7f-444d-99bb-cc0ed5a8a02c awaiting client
State: WAITING on java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@372bae43
Total blocked: 1  Total waited: 38

Stack trace: 
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
Source)
java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

Seem like the wait.until() is causing the troubles.

Reported by ivanlvasilev on 2014-05-09 08:23:05

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I'm facing the same issue since upgrading to 2.41.0 last week (along with Firefox 29.0.1).
The symptom is that I start my Java program and it hangs; I look in Task Manager and
see a Firefox.exe with very little memory use; I end that process and immediately the
Java program continues to open a new browser window and proceed normally.  However,
if I don't do this within a certain amount of time, the program eventually aborts with
the port 7054 error.

Reported by zafrir.benyehuda@pensco.com on 2014-05-12 15:19:38

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I have just upgraded to 2.42.1.

I am no longer having this issue with the firefox.exe getting stuck, 

one thing to note, make sure you do a driver.close() before the driver.quit(), without
the close i am still getting the issue.

Reported by jimusbobus on 2014-06-02 15:24:05

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

On further investigation it is not fixed :( but it does seem a lot less frequent, and
better on FF 29.0.1, but that could well be a coincidence...

Reported by jimusbobus on 2014-06-02 16:36:19

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

final post for today I promise!!

Just run 100 tests, if you ensure that only ever 1 concurrent FF session at a time
then I do not get this issue..

Reported by jimusbobus on 2014-06-02 16:58:36

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I am also plagued by this issue on 2.41 (Firefox 28 and 29) and if I upgrade to selenium
Java 2.42 I get the following Firefox startup error instead "Error forwarding new session
JSON response body did not contain a session ID". More info on that here: https://code.google.com/p/selenium/issues/detail?id=7421.
I've also noticed the safe mode pop up.

@Jimusbobus, I wouldn't consider that a solution since the main selling point of selenium
grid is that you are able to run many browsers on one operating system instance to
save resources and time (hence the need for a locking mechanism). Only running one
FF instance shouldnt produce that issue because no other instance is trying to aquire
the lock. This is still a major problem, its ruining my Firefox testing.

Reported by AdamJasonDev on 2014-06-03 14:10:32

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

First off, this error message seems to have changed from "Failed to bind to locking
port after 45000ms" (2.41) to "JSON reponse body did not contain session ID" (2.42).

Each Firefox RemoteWebDriver instance aquires a lock when starting up on a node. I
have a factory class called WebDriverFactory which I use to generate all of my WebDrivers
whether they are supposed to run locally, remotely, on whatever browser with whatever
desired settings. I have a 10 seconds pause in between browser creation. This seems
to be enough time for all browsers EXCEPT for Firefox. The error message says that
the browser could not aquire the lock after 45 seconds. I've timed some of my Firefox
startup times when the grid is in the process of "throttling up" after a batch of tests
have been dispatched and they took as long as ~30 seconds. Therefore, if one instance
is taking ~30 seconds to start and has the lock, its very likely that a thread has
been dispatched, waited longer than 45 seconds for the lock and timed out.

WORKAROUND #1: If you have a WebDriverFactory like I do, place the synchronized directive
in the method header. That way only one browser on ANY node will start a time. This
has resolved the issue for me so far.

WORKAROUND #2: Workaround 1 is a bit slow starting my tests (not such a terrible thing.
I like to call it, hitting the gas slowly). Another option would be to place a syncronized
directive around the block of code dispatching the remote Firefox WebDriver (return
new RemoteWebDriver(FirefoxProfile). That way only remote Firefox tests are required
to go one after another and Chrome / IE can just have a short wait time in between
thread dispatching.


Does that make sense?

Reported by AdamJasonDev on 2014-06-03 18:50:20

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hello all,

I want to confirm that the issue is still not resolved. We have a grid environment
with FF26 and selenium-server 2.39 the issue appears 1-3 times per week. Today we have
updated the environment to use the latest selenium-server 2.42.2 and Firefox 29.0.1.
The issue appears more frequently (3 times for less than 3 hours). In order to workaround
it we have created a powershell script which will monitor all processes and to kill
firefox browser instances which run for more than a minute and have less than 50 MB
memory utilization. Using this script we have managed to kill those hung firefox browser
instances and the respective test case is marked as skipped but the rest of the tests
are still executing. 

You can find the script attached. I guess this one can be used as a temporary solution
until a real fix is applied in the selenium-server.

Reported by Stanoev.Nikolay on 2014-06-13 10:21:48


- _Attachment: [Remove hung firefox browser instances.ps1](https://storage.googleapis.com/google-code-attachments/selenium/issue-7272/comment-16/Remove hung firefox browser instances.ps1)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I had identified the root cause of the said issue. This is happening because there is
a unlimited wait while cleaning the firefox profile before creation. Sometimes the
cleaning process hangs and does not release the locked port and hence we get this issue
while creating a new session.
I had raised a pull request with the fixes. Following is the pull request:
https://github.com/SeleniumHQ/selenium/pull/229

Reported by mr.varun.menon on 2014-06-23 12:09:37

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

This issue was closed by revision 9f3a561cce81.

Reported by barancev on 2014-06-24 20:40:07

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

@barancev: when is a release including this fix expected to come out?

Reported by correia@textkernel.nl on 2014-06-27 10:05:28

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 7559 has been merged into this issue.

Reported by barancev on 2014-07-03 17:20:16

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

*ping* when will this make it out to a build?

Reported by antek.baranski on 2014-08-21 16:32:15

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I'd also like it for this to be released - without it I can either have a large grid
or a reliable grid, but not both :/

Reported by AIMMac23 on 2014-08-26 15:15:40

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue #7272 is not called out specifically as fixed in the 2.43.0/1 change list.  Can
you confirm please?  

This looks like a reasonable match: 
v2.43.1
=======

  * Fixing socketlock bug with reusing the same profile multiple times

Reported by talkingtree on 2014-09-10 19:40:33

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Doesn't fix it :(

2014-09-10_20:21:02.95908 Build info: version: '2.43.1', revision: '5163bce', time:
'2014-09-10 16:27:33'
2014-09-10_20:21:02.95908 System info: host: 'HOSTNAME', ip: '10.190.113.97', os.name:
'Linux', os.arch: 'amd64', os.version: '2.6.32-431.23.3.el6.x86_64', java.version:
'1.7.0_65'
2014-09-10_20:21:02.95911 Driver info: driver.version: unknown
2014-09-10_20:21:02.95911   at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2014-09-10_20:21:02.95912   at java.util.concurrent.FutureTask.get(FutureTask.java:188)
2014-09-10_20:21:02.95913   at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:176)
2014-09-10_20:21:02.95913   at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:112)
2014-09-10_20:21:02.95914   at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:89)
2014-09-10_20:21:02.95914   at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:108)
2014-09-10_20:21:02.95915   at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:57)
2014-09-10_20:21:02.95915   at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
2014-09-10_20:21:02.95917   at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:112)
2014-09-10_20:21:02.95918   at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:173)
2014-09-10_20:21:02.95919   at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:201)
2014-09-10_20:21:02.95919   at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:163)
2014-09-10_20:21:02.95920   at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
2014-09-10_20:21:02.95921   at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:129)
2014-09-10_20:21:02.95921   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
2014-09-10_20:21:02.95922   at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
2014-09-10_20:21:02.95922   at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
2014-09-10_20:21:02.95923   at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
2014-09-10_20:21:02.95924   at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
2014-09-10_20:21:02.95924   at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
2014-09-10_20:21:02.95926   at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
2014-09-10_20:21:02.95926   at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
2014-09-10_20:21:02.95927   at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
2014-09-10_20:21:02.95929   at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
2014-09-10_20:21:02.95930   at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
2014-09-10_20:21:02.95931   at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
2014-09-10_20:21:02.95932   at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
2014-09-10_20:21:02.95932 Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
2014-09-10_20:21:02.95933 Build info: version: '2.43.1', revision: '5163bce', time:
'2014-09-10 16:27:33'
2014-09-10_20:21:02.95933 System info: host: 'HOSTNAME', ip: '10.190.113.97', os.name:
'Linux', os.arch: 'amd64', os.version: '2.6.32-431.23.3.el6.x86_64', java.version:
'1.7.0_65'
2014-09-10_20:21:02.95934 Driver info: driver.version: unknown
2014-09-10_20:21:02.95934   at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:69)
2014-09-10_20:21:02.95935   at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:53)
2014-09-10_20:21:02.95937   at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:54)
2014-09-10_20:21:02.95938   at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:215)
2014-09-10_20:21:02.95938   at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
2014-09-10_20:21:02.95940   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
2014-09-10_20:21:02.95941   at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
2014-09-10_20:21:02.95942   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2014-09-10_20:21:02.95942   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2014-09-10_20:21:02.95943   at java.lang.Thread.run(Thread.java:745)
2014-09-10_20:21:02.95943 Caused by: java.lang.reflect.InvocationTargetException
2014-09-10_20:21:02.95944   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
2014-09-10_20:21:02.95945   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
2014-09-10_20:21:02.95945   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2014-09-10_20:21:02.95947   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
2014-09-10_20:21:02.95947   at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:59)
2014-09-10_20:21:02.95948   ... 9 more
2014-09-10_20:21:02.95949 Caused by: org.openqa.selenium.WebDriverException: Failed
to connect to binary FirefoxBinary(/usr/local/bin/firefox) on port 7056; process output
follows: 
2014-09-10_20:21:02.95949 
2014-09-10_20:21:02.95950 Build info: version: '2.43.1', revision: '5163bce', time:
'2014-09-10 16:27:33'
2014-09-10_20:21:02.95950 System info: host: 'n7vgd1clubpsel02', ip: '10.190.113.97',
os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-431.23.3.el6.x86_64', java.version:
'1.7.0_65'
2014-09-10_20:21:02.95951 Driver info: driver.version: FirefoxDriver
2014-09-10_20:21:02.95952   at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:134)
2014-09-10_20:21:02.95952   at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
2014-09-10_20:21:02.95953   at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
2014-09-10_20:21:02.95953   at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
2014-09-10_20:21:02.95955   at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
2014-09-10_20:21:02.95956   at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104)
2014-09-10_20:21:02.95956   ... 14 more
2014-09-10_20:21:02.95957 Caused by: org.openqa.selenium.WebDriverException: java.lang.InterruptedException:
Process timed out after waiting for 45000 ms.
2014-09-10_20:21:02.95957 Build info: version: '2.43.1', revision: '5163bce', time:
'2014-09-10 16:27:33'
2014-09-10_20:21:02.95958 System info: host: 'HOSTNAME', ip: '10.190.113.97', os.name:
'Linux', os.arch: 'amd64', os.version: '2.6.32-431.23.3.el6.x86_64', java.version:
'1.7.0_65'
2014-09-10_20:21:02.95959 Driver info: driver.version: FirefoxDriver
2014-09-10_20:21:02.95959   at org.openqa.selenium.os.CommandLine.waitFor(CommandLine.java:131)
2014-09-10_20:21:02.95960   at org.openqa.selenium.firefox.FirefoxBinary.waitFor(FirefoxBinary.java:222)
2014-09-10_20:21:02.95960   at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:242)
2014-09-10_20:21:02.95961   at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:91)
2014-09-10_20:21:02.95962   ... 19 more
2014-09-10_20:21:02.95962 Caused by: java.lang.InterruptedException: Process timed
out after waiting for 45000 ms.
2014-09-10_20:21:02.95965   at org.openqa.selenium.os.UnixProcess.waitFor(UnixProcess.java:148)
2014-09-10_20:21:02.95965   at org.openqa.selenium.os.CommandLine.waitFor(CommandLine.java:129)
2014-09-10_20:21:02.95966   ... 22 more
2014-09-10_20:21:02.95967 13:21:02.959 WARN - Exception: Process timed out after waiting
for 45000 ms.

Reported by antek.baranski on 2014-09-10 20:23:06

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Yes, the fix is shipped with the release 2.43.
No idea why it is not mentioned in the changelog.

Reported by barancev on 2014-09-11 05:41:45

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

@antek.baranski: Yes, now it fails instead of hanging forever, at mentioned in the original
report. And other sessions have a chance to start successfully (because the locking
port is released after a failure).

Would you suggest a better solution please describe it or create a pull request.

Or may be someone has an idea WHY the profile cleaning fails sometimes.

Reported by barancev on 2014-09-11 05:45:40

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

(because the locking port is released after a failure). This is also not true. I got
11 retries and just after that the port will be free.

Can you please describe the reason why is this happening?

Reported by gangeld on 2014-10-22 07:11:14

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I had the same error as in #27. The reason in my case was that the user running the
selenium server did not have a home directory.

Reported by esuuronen on 2014-10-24 14:33:39

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

@barancev: was it fixed for python binding?
I have selenium 2.41(python version) version and sometimes firefox browser doesn't
die after test ends.

Reported by Malafeev.Alexey on 2014-11-20 12:14:08

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I get this exception when running python unittests using selenium docker image selenium/standalone-firefox:2.44.0
and machine is low on resources.

Is there a timeout setting that can be set?

Reported by andrej.krpic on 2015-01-08 14:42:13

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

this issue is not fixed. we get it with selenium 2.44 and ff 34

Reported by domnulnopcea on 2015-02-11 07:36:36

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

an issue is still there for latest Grid version with C#. 

Reported by sidor_a.moved@tut.by on 2015-02-11 12:50:58

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

A workaround that I had tried with java is as below where use a new port if the default
has the port binding issue. Note: ... code is irrelevant in the current issue context.
Hope this helps.


....

public  static int browserRetryCount =
                    Integer.parseInt(System.getProperty("webdriver.instance.retry.count","5"));

static int browserAttempt = 1;

public WebDriver getConnection(String browserType) {
  ...
     try {
             ...
              browserDriver = new FirefoxDriver(capabilities);
             ...

     } catch (Exception e) {
                Logger.logMessage("Error while initializing Driver object: "+e.getMessage());
                        String bindErrorMessage = "Unable to bind to locking port";
                        if ((e.getMessage().contains(bindErrorMessage)) && (browserAttempt<=browserRetryCount))
{
                            Logger.logMessage("Attemp2: browser instance creation!");
                            browserAttempt++;
                            int newPort = 7060+new java.util.Random().nextInt(10);
                            Logger.logMessage("newPort="+newPort);
                            System.setProperty("webdriver.firefox.port", newPort+"");
                            getConnection(browserType);                           
                        } else {
                            throw new UIFailure("Not able to create a driver object",e);
                        }
            }
}


Reported by jagadesh.munta on 2015-02-25 15:52:46

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

This issue is related to:

https://code.google.com/p/selenium/issues/detail?id=8593

Reported by appliedsoftwaredesign on 2015-03-10 14:44:54

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

For me, increasing the value of FirefoxBinary.timeout field helped to avoid the problem.
I use grid configuration with ~40 dockerized nodes, I regularly observe a situation,
where 5-8 remote sessions are started in the same time and then this problem is visible.

Unfortunately I found no possibility to increase that timeout by configuration, I have
to use custom-compiled version. Or maybe somebody knows how to do this?

I tried to pass custom FirefoxBinary via DesiredCapabilities, but it doesn't work with
whole object in remote configuration (only executable path can be specified as string).

Reported by tporeba on 2015-03-30 13:45:56

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016



try this.

                   FirefoxProfile ffProfile = new FirefoxProfile();
                  FirefoxBinary ffBinary = new FirefoxBinary();
                  ffBinary.setTimeout(TimeUnit.SECONDS.toMillis(180));
                   driver = new FirefoxDriver(ffBinary, ffProfile);

Reported by suman583 on 2015-05-05 11:22:47

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issues is still not fixed with 2.45.

Reported by amoghdhumal on 2015-05-22 11:22:30

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue is found when ran on grid with 2.45 & 2.46

Reported by manjunathscp on 2015-06-19 10:21:46

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hello All,

Still this issue is occurring in grid 2.46 and firefox 37 versions.

Here is I got:
Driver Info: RemoteWebDriver: firefox on WINDOWS (58a94973-12e6-4aae-8879-9e0bb29d3692)
 WebDriver instance issue...
org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within
45000 ms
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:16:47'
Driver info: driver.version: FirefoxDriver
Command duration or timeout: 90.31 seconds

Reported by rp.krish on 2015-07-02 18:17:46

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:22:22

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant