Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms #1350

Closed
EldarAgalarov opened this issue Dec 6, 2015 · 18 comments
Closed

Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms #1350

EldarAgalarov opened this issue Dec 6, 2015 · 18 comments

Comments

@EldarAgalarov
Copy link

Selenium 2.48.2 throws exception
Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms
when I'm using Firefox 42.0 64-bit on Windows. With Firefox 42.0 32-bit all works fine.

@candybaby407
Copy link

Update as below:

It turned out that there is one element cannot be located due to the selector error, then the error is logged as this. After correct the selector for the element, all works fine now.

This issue also reproduce for my test on IE.
Windows 8.1 AMD64
IE11 (11.0.9600.18096)

@lkende
Copy link

lkende commented Dec 14, 2015

I can confirm the same results for FF 42 64-bit on Windows 10, 8.1, 8, and 7x64.

It's curious that the port mentioned is 7055, as the normal FF connects at http://127.0.0.1:4444/wd/hub using RemoteWebDriver.

@lukeis
Copy link
Member

lukeis commented Dec 14, 2015

@lkende 7055 is the internal port that we start the firefox driver 'server' inside of the firefox browser plugin. The standalone server runs on 4444 and then after starting up the browser, forwards requests to this other server. (Which is why the second comment on this thread makes no sense and I have no idea how IE could exhibit the same behavior).

This error message means that selenium tried to start up firefox but couldn't get a response from the server started up by our 'webdriver.xpi' (firefox extension). It would be helpful to try and get the browser console logs for when this occurs. (helpful, but might not tell us why exactly it failed). The browser console logs can be brought up by pressing ctrl + shift + J

@lkende
Copy link

lkende commented Dec 14, 2015

@lukeis Thanks for the clarification... I suspected. The Firefox browser closes once the the exception is thrown, but here's what I could get from the console logs and another file for the details of the Java's exception. Hope that helps.

ff-console.txt
ff-exception.txt

@tommywo
Copy link
Contributor

tommywo commented Dec 15, 2015

I'm getting similar error

org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'xxxxxx', ip: 'xxxxxx', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_60'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:100)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:90)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:117)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:128)

@SpencerMalone
Copy link

Are you folks running things in parallel, or do you only have one instance per node?

@lkende
Copy link

lkende commented Dec 16, 2015

No hub, nor parallel requests. Only the one instance of the server and one client request.

@merike
Copy link

merike commented Dec 30, 2015

I lack further details but I suspect it's possible to have Firefox report as if it has been upgraded when it really has not. I got

Failed to connect to binary FirefoxBinary(C:\FF-Selenium\firefox.exe) on port 7055; process output follows:
1451448230752 addons.manager DEBUG Application has been upgraded

on a machine today morning and Firefox definitely has not upgraded itself. There isn't an update staged and waiting to be applied in Firefox folder either.

@barancev
Copy link
Member

Duplicate of #1431

@erm3nda
Copy link

erm3nda commented May 11, 2016

@lukeis Yep, the port 7055 is the internal server, the extension. I'm not sure but I think it's a repl interface. I've installed that extension manually on my server and I can see the port running, but don't know how should I connect it from webdriver.Firefox or even webdriver.Remote(). Also tried using telnet to 7055 and loads httpd.js server from the extension. Is there any documentation to learn it's interface?

@nawazshaik
Copy link

I too had the same error but issue is resolved upon downgrading Firefox version to 35.0.1.

I am using selenium 2.43 and Firefox 35.0.1

@adam-nielsen
Copy link

Just encountered this same issue. The browser window appears for 30 seconds before the Selenium process times out and closes the window again.

If, in those 30 seconds, you type about:addons into the URL then you can see that there is only one addon installed - the WebDriver one - and it is disabled with a big red message that says "Firefox WebDriver could not be verified for use in Firefox and has been disabled".

I am wondering whether this is part of the e10s updates that Mozilla have done, as apparently this has a tendency to break addons, so they may have disabled them all as a precaution until they can be verified. I'm not sure whether it's just a matter of bumping a version number in the .xpi file, or whether it's more complex.

@marco-c
Copy link

marco-c commented Jun 15, 2016

See also #2110.

@adam-nielsen which version of Firefox are you using? The error looks related to addon signing, but addon signing is not enabled in Firefox 47.

@adam-nielsen
Copy link

@marco-c: I tried it in Firefox 47 then went back to 45 but both are showing the same problem. If I go into about:config before the Selenium instance closes it, xpinstall.signatures.required is true, and xpinstall.whitelist.required is also true. I tried manually changing both these to false, then the addons page said the WebDriver addon would be enabled after a restart, but of course that's not really possible via Selenium.

Perhaps the mini-profile that Selenium creates for Firefox needs to have these two options set to false as well?

@marco-c
Copy link

marco-c commented Jun 15, 2016

@adam-nielsen, I thought Selenium already did that:

"xpinstall.signatures.required": false,

Btw, you can do it yourself, e.g. something similar to https://www.seleniumeasy.com/selenium-tutorials/firefox-profile-preferences-using-selenium-webdriver.

@adam-nielsen
Copy link

@marco-c: How are those options being set? The filename webdriver.json suggests it's the add-on changing the settings, which of course won't work if Firefox isn't loading the add-on in the first place.

That second link of yours looks like it sets the options without using the add-on, so presumably this would be the only way to get it to work - I'll try it and report back if I have any luck.

@adam-nielsen
Copy link

That seemed to do the trick. You have to set xpinstall.signatures.required to false manually in the Firefox profile. With PHPUnit and the Facebook code:

$caps = Facebook\WebDriver\Remote\DesiredCapabilities::firefox();
$profile = $caps->getCapability(Facebook\WebDriver\Firefox\FirefoxDriver::PROFILE);
$profile->setPreference("xpinstall.signatures.required", false);
$caps->setCapability(Facebook\WebDriver\Firefox\FirefoxDriver::PROFILE, $profile);
$webDriver = Facebook\WebDriver\Remote\RemoteWebDriver::create(
    'http://localhost:4444/wd/hub', $caps
);

The addon then shows up with the message Firefox WebDriver could not be verified for use in Firefox. Proceed with caution. but it works and commands can be sent to the browser.

I guess this is more a fix for the Facebook WebDriver than Selenium itself?

@huyendtt58
Copy link

add pom.xml

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-firefox-driver</artifactId>
        <version>2.53.1</version>
    </dependency>

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Aug 2, 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