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

Unexpected connnection refused on first spawn of geckodriver. #1616

Closed
rasjani opened this issue Sep 11, 2019 · 14 comments
Closed

Unexpected connnection refused on first spawn of geckodriver. #1616

rasjani opened this issue Sep 11, 2019 · 14 comments
Labels

Comments

@rasjani
Copy link

@rasjani rasjani commented Sep 11, 2019

System

  • Version: 0.25.0
  • Platform: Windows
  • Firefox: 68.0
  • Selenium: 3.41.0 Python

Testcase

First off, this is really bad bug report, reason later:

Im running a test set in Azure Pipelines for osx/linux/windows and after the 0.25.0 release hit my pipeline, first time selenium started geckodriver, i get `WebDriverException: connection refused´ exception.

After the test run, when the pipeline wants to collect the build logs, geckodriver.log is still open/locked so, it almost feels like the geckodriver process is still running. And because i run on hosted agents, i just cant fetch those atm ..

However, after pinning my geckodriver on windows to 0.24.0, i havent seen the issue.

@andreastt

This comment has been minimized.

Copy link
Member

@andreastt andreastt commented Sep 12, 2019

@rdharrison2

This comment has been minimized.

Copy link

@rdharrison2 rdharrison2 commented Sep 12, 2019

I'm also seeing this with version 0.25.0 (64-bit) but for some reason only on Windows 10 1903 (1803 is working fine).

On Windows 10 1903 running "geckodriver.exe --version" results in no output and no obvious errors I can find - the process just terminates and hence selenium server is failing to connect to it to launch Firefox. Reverting to 0.24.0 fixes the issue.

I tried turning off the Windows Firewall and Windows Defender temporarily but this didn't make a difference.

@andreastt

This comment has been minimized.

Copy link
Member

@andreastt andreastt commented Sep 12, 2019

I don’t have access to a Windows system, but I wonder if there’s a problem with the Windows binaries for 0.25.0.

@rasjani

This comment has been minimized.

Copy link
Author

@rasjani rasjani commented Sep 13, 2019

I run Windows on azure because i dont have access to Windows. Thus, checking if i can run things manually is a bit hard atm. Windows version in azure hosted agent should be Windows Server 2016 but im not aware of what patch level it has.

Considering that it is only the first invocation that fails (my tests open geckodriver around 24 times within the whole test run) I’d assume that it might not be windows firewall. Now that the binary is signed - maybe there’s some delay when verifying the binary ? And since it’s already verified from the first run, consecutive launches don’t have that delay on the fresh image ? But that’s just speculation - I don’t know anything about the topic.

@whimboo

This comment has been minimized.

Copy link
Collaborator

@whimboo whimboo commented Sep 25, 2019

What does first run mean here? Is it the really first run of the binary, or does it also always happen after restarting Windows? Maybe you could use the FileMon tool from Microsoft, and figure out which exact system call/access fails?

@rasjani

This comment has been minimized.

Copy link
Author

@rasjani rasjani commented Sep 26, 2019

First Run in my scenario:

  • Azure spins a new agent (fresh image, dunno if its booted up before or not).
  • First test that requires firefox spawns geckodriver from selenium python api and fails and marking the testcase as failed
  • Suite gets finished and new suite starts, new geckodriver is spawned, and it works.

Since i dont have access to windows devices and the tests on azure run on hosted agents - to which i probably cant rdp into - i cant provide more details at this time.

@whimboo

This comment has been minimized.

Copy link
Collaborator

@whimboo whimboo commented Sep 27, 2019

Given that you are running on Windows, could you check if the test builds on issue #1617 make a difference for you? See #1617 (comment) for the links. Thanks.

@rasjani

This comment has been minimized.

Copy link
Author

@rasjani rasjani commented Sep 28, 2019

During my testrun, i launch geckodriver about 25 times and only the first launch seemed to be failing. If the issue would be due to missing dll, i'd assume that geckodriver wouldnt launch at all.

But i can give a try but using a separate binary as its now shipped, will take time as i have to make changes to my ci pipeline..

@whimboo

This comment has been minimized.

Copy link
Collaborator

@whimboo whimboo commented Sep 30, 2019

The only other thing might be related to the signed builds. Do you have access to the Windows Event viewer, or at least the logs from it? Maybe we can find some interesting info in there. Are on those workers running any kind of antivirus software?

@rasjani

This comment has been minimized.

Copy link
Author

@rasjani rasjani commented Oct 2, 2019

Im actually seeing this now in v0.24.0 too. Not that often but its there. https://github.com/rasjani/robotframework-seleniumtestability/pull/17/checks?check_run_id=244901261 .. but thats pretty useless for debugging purposes..

@whimboo

This comment has been minimized.

Copy link
Collaborator

@whimboo whimboo commented Oct 12, 2019

Can anyone please try the release candidate builds of geckodriver 0.26.0? I would like to know if those fix the problem for you all.

https://github.com/mozilla/geckodriver/releases/tag/v0.26.0

@rasjani

This comment has been minimized.

Copy link
Author

@rasjani rasjani commented Oct 15, 2019

so far looks good - no random failures.

At least in azure 'VS2017-Win2016' images, 0.26.0 seems to be more stabile than previous release.

Feel free to close the issue.

@whimboo

This comment has been minimized.

Copy link
Collaborator

@whimboo whimboo commented Oct 15, 2019

Great to hear that. So yes, lets close this issue.

@lock

This comment has been minimized.

Copy link

@lock lock bot commented Nov 29, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Nov 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.