mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.21k stars 1.53k forks source link

Occasional Connection refused (os error 111) when when running selenium suite #1892

Open PiotrZgadzaj opened 3 years ago

PiotrZgadzaj commented 3 years ago

System

Testcase

We run selenium suite on company kubernetes-based cloud and sometimes, os error 111 are thrown. Usually it's like that few first tests of a suite fails and usually situation fixes itself automatically, so the remaining tests are able to succeed

Stacktrace

May 28, 2021 2:30:05 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) May 28, 2021 2:30:55 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) May 28, 2021 2:31:07 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) May 28, 2021 2:32:02 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) May 28, 2021 2:32:09 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) May 28, 2021 2:33:05 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) May 28, 2021 2:33:12 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '500' -> incorrect JSON status mapping for 'timeout' (408 expected) May 28, 2021 2:33:38 AM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C .... Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z' System info: host: 'sbf-high-medium-lvkn0', ip: '10.233.74.189', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-91-generic', java.version: '1.8.0_252' Driver info: some.package.FirefoxWebDriverWithBackportForBugs Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 85.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:buildID: 20210118153634, moz:geckodriverVersion: 0.29.0, moz:headless: true, moz:processID: 4262, moz:profile: /tmp/rust_mozprofile2wQAN0, moz:shutdownTimeout: 60000, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, platformVersion: 4.15.0-91-generic, rotatable: false, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify} Session ID: 319012db-5f63-477f-9fb9-8d0b71baec9c at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.service.DriverCommandExecutor.e

Trace-level log

I don't have trace logs yet. Some logs from firefox would be helpfull as well?

whimboo commented 3 years ago

Yes, trace-level logs from geckodriver would be helpful. Those will also include logs from Firefox. So no extra log fetching would be necessary. Thanks!

zhuyuemings commented 2 years ago

I also encountered this problem when i start firefox with selenium, it happens

original stacktrace here:


org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Connection refused (os error 111)
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'LdapServer', ip: '10.0.1.10', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-1160.41.1.el7.x86_64', java.version: '1.8.0_292'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {args: [-headless, -private, --no-sandbox, about:blank], binary: /work/deploy/res/software/f..., log: {level: trace}}}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {args: [-headless, -private, --no-sandbox, about:blank], binary: /work/deploy/res/software/f..., log: {level: trace}}}}]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:164)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:139)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:168)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:198)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:194)
    at com.tinypace.selenium.enums.Browser$2.init(Browser.java:129)
    at com.tinypace.selenium.driver.TinyWebDriver.initDriver(TinyWebDriver.java:461)
    at com.tinypace.selenium.driver.TinyWebDriver.init(TinyWebDriver.java:421)
    at Test.checkParamAndInit(Test.java:70)
    at Test.main(Test.java:34)

trace log here :

driver.txt

it looks like network went something wrong? any one can help me to solve this problem? many thanks!!!

@whimboo

zhuyuemings commented 2 years ago

but other browser( Microsoft Edge 95.0.1020.53(Linux-10.0.1.10), Google Chrome 93.0.4577.63(Linux-10.0.1.10) ) working fine at same time on same machine.

whimboo commented 2 years ago

@zhuyuemings Firefox takes a very long time to start-up. Maybe it's due to your usage of the --no-sandbox command line argument for Firefox. Please try to remove as many as possible customizations for the New Session command to get Firefox not behaving that badly. Nevertheless it might make sense to file a bug against Firefox directly. It doesn't seem to be a geckodriver issue at all.

zhuyuemings commented 2 years ago

ok, i will try, many thanks!!!