An application my team and I are developing makes use of a firefox selenium driver in python for ppc64le architectures. I noticed that this module in our application was not functioning due to an inability for the python library to connect to the geckodriver. I also noticed that the x86_64 version of our app is functioning with the same version of firefox and geckodriver.
The python error we are seeing is the following:
TimeoutException: Message: connection refused
The timeout was set to 10 seconds, so I updated it to 40, and then 300 and got the same issue.
geckodriver starts up without any errors. but selenium can't seem to connect to it.
Upon deploying an old version of a docker container of our app (based on ubuntu 18.04), I compared versions of the old version, which selenium worked, vs the new version which selenium does not work. What I found was that although the apt packages for firefox and geckodrivers seem to point to a v75.0 build of firefox, the version in geckodriver did not change between version upgrades.
so,
firefox version changed 72.0.2 -> 75.0
geckodriver did not 36.0 -> 36.0
I suspect this is the source of the issue, because if firefox changes and the geckodriver remains the same, they won't sync up right.
========= Versions on non-working image (version from Apr 30, 2020 on ppc64le) =================
root@0d1a13cbda24:/usr/src/lens# pip show selenium
if you can create the driver successfully, you've made it past our bug.
Name: selenium
Version: 3.141.0
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: /usr/local/lib/python3.7/dist-packages
Requires: urllib3
Required-by:
======= Versions on working image (image from jan 29th, 2020 on ppc64le) ==================
if you can create the driver successfully, you've made it past our bug.
*** 72.0.2+build1-0ubuntu0.18.04.1 500
500 http://ports.ubuntu.com/ubuntu-ports bionic-updates/main ppc64el Packages
500 http://ports.ubuntu.com/ubuntu-ports bionic-security/main ppc64el Packages
100 /var/lib/dpkg/status
root@b5d05f80b923:/usr/src/lens# firefox --version
Mozilla Firefox 72.0.2
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
if you can create the driver successfully, you've made it past our bug. Otherwise, it fails on
>>> driver = _get_driver()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 5, in _get_driver
File "/env/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
keep_alive=True)
File "/env/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/env/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/env/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/env/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: connection refused
Hi all,
An application my team and I are developing makes use of a firefox selenium driver in python for ppc64le architectures. I noticed that this module in our application was not functioning due to an inability for the python library to connect to the geckodriver. I also noticed that the x86_64 version of our app is functioning with the same version of firefox and geckodriver.
The python error we are seeing is the following:
TimeoutException: Message: connection refused
The timeout was set to 10 seconds, so I updated it to 40, and then 300 and got the same issue.
geckodriver starts up without any errors. but selenium can't seem to connect to it.
Upon deploying an old version of a docker container of our app (based on ubuntu 18.04), I compared versions of the old version, which selenium worked, vs the new version which selenium does not work. What I found was that although the apt packages for firefox and geckodrivers seem to point to a v75.0 build of firefox, the version in geckodriver did not change between version upgrades.
so,
firefox version changed 72.0.2 -> 75.0
geckodriver did not 36.0 -> 36.0
I suspect this is the source of the issue, because if firefox changes and the geckodriver remains the same, they won't sync up right.
========= Versions on non-working image (version from Apr 30, 2020 on ppc64le) =================
root@0d1a13cbda 24:/usr/ src/lens# lsb_release -rd
Description: Ubuntu 18.04.3 LTS
Release: 18.04
root@0d1a13cbda 24:/usr/ src/lens# apt-cache policy firefox 0ubuntu0. 18.04.1 0ubuntu0. 18.04.1 0ubuntu0. 18.04.1 500 ports.ubuntu. com/ubuntu- ports bionic-updates/main ppc64el Packages ports.ubuntu. com/ubuntu- ports bionic- security/ main ppc64el Packages dpkg/status 0.2+build1- 0ubuntu1 500 ports.ubuntu. com/ubuntu- ports bionic/main ppc64el Packages
firefox:
Installed: 75.0+build3-
Candidate: 75.0+build3-
Version table:
*** 75.0+build3-
500 http://
500 http://
100 /var/lib/
59.
500 http://
root@0d1a13cbda 24:/usr/ src/lens# apt-cache policy firefox-geckodriver geckodriver: 0ubuntu0. 18.04.1 0ubuntu0. 18.04.1 0ubuntu0. 18.04.1 500 ports.ubuntu. com/ubuntu- ports bionic-updates/main ppc64el Packages ports.ubuntu. com/ubuntu- ports bionic- security/ main ppc64el Packages
firefox-
Installed: 75.0+build3-
Candidate: 75.0+build3-
Version table:
*** 75.0+build3-
500 http://
500 http://
root@0d1a13cbda 24:/usr/ src/lens# firefox --version
Mozilla Firefox 75.0
root@0d1a13cbda 24:/usr/ src/lens# geckodriver --version
geckodriver 0.26.0
root@0d1a13cbda 24:/usr/ src/lens# pip show selenium
if you can create the driver successfully, you've made it past our bug. /github. com/SeleniumHQ/ selenium/ lib/python3. 7/dist- packages
Name: selenium
Version: 3.141.0
Summary: Python bindings for Selenium
Home-page: https:/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: /usr/local/
Requires: urllib3
Required-by:
======= Versions on working image (image from jan 29th, 2020 on ppc64le) ==================
root@b5d05f80b9 23:/usr/ src/lens# lsb_release -rd
Description: Ubuntu 18.04.3 LTS
Release: 18.04
root@b5d05f80b9 23:/usr/ src/lens# apt-cache policy firefox build1- 0ubuntu0. 18.04.1 build1- 0ubuntu0. 18.04.1 build1- 0ubuntu0. 18.04.1 500 ports.ubuntu. com/ubuntu- ports bionic-updates/main ppc64el Packages ports.ubuntu. com/ubuntu- ports bionic- security/ main ppc64el Packages dpkg/status 0.2+build1- 0ubuntu1 500 ports.ubuntu. com/ubuntu- ports bionic/main ppc64el Packages
firefox:
Installed: 72.0.2+
Candidate: 72.0.2+
Version table:
*** 72.0.2+
500 http://
500 http://
100 /var/lib/
59.
500 http://
root@b5d05f80b9 23:/usr/ src/lens# apt-cache policy firefox-geckodriver geckodriver: build1- 0ubuntu0. 18.04.1 build1- 0ubuntu0. 18.04.1
firefox-
Installed: 72.0.2+
Candidate: 72.0.2+
Version table:
if you can create the driver successfully, you've made it past our bug. build1- 0ubuntu0. 18.04.1 500 ports.ubuntu. com/ubuntu- ports bionic-updates/main ppc64el Packages ports.ubuntu. com/ubuntu- ports bionic- security/ main ppc64el Packages dpkg/status
*** 72.0.2+
500 http://
500 http://
100 /var/lib/
root@b5d05f80b9 23:/usr/ src/lens# firefox --version
Mozilla Firefox 72.0.2
root@b5d05f80b9 23:/usr/ src/lens# geckodriver --version
geckodriver 0.26.0
root@b5d05f80b9 23:/usr/ src/lens# pip show selenium /github. com/SeleniumHQ/ selenium/ lib/python3. 7/dist- packages
Name: selenium
Version: 3.141.0
Summary: Python bindings for Selenium
Home-page: https:/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: /usr/local/
Requires: urllib3
Required-by:
===== Test python code to try =======
# docker run -it -u 0 --rm ubuntu:18.04 bash
then run the following:
> apt update -y && sudo apt upgrade -y
> apt upgrade -y
> apt install python3-venv python3.7 python3.7-venv firefox firefox-geckodriver
> python3.7 -m venv env
> source env/bin/activate
> pip install selenium==3.141.0
> python3.7
paste in the code below:
from selenium import webdriver common. exceptions import NoSuchElementEx ception, TimeoutException webdriver. firefox. options import Options as FirefoxOptions webdriver. firefox. firefox_ profile import FirefoxProfile webdriver. common. by import By webdriver. support import expected_conditions webdriver. support. ui import WebDriverWait webdriver. support import expected_conditions as EC
from selenium.
from selenium.
from selenium.
from selenium.
from selenium.
from selenium.
from selenium.
SELENIUM_TIMEOUT = 40
def _get_profile():
profile = FirefoxProfile()
return profile
def _get_driver(): headless = True Firefox( options= options, firefox_ profile= profile, executable_ path='geckodriv er') set_page_ load_timeout( SELENIUM_ TIMEOUT)
options = FirefoxOptions()
options.
profile = _get_profile()
_driver = webdriver.
_driver.
driver = _get_driver()
if you can create the driver successfully, you've made it past our bug. Otherwise, it fails on
>>> driver = _get_driver() python3. 7/site- packages/ selenium/ webdriver/ firefox/ webdriver. py", line 174, in __init__ alive=True) python3. 7/site- packages/ selenium/ webdriver/ remote/ webdriver. py", line 157, in __init__ start_session( capabilities, browser_profile) python3. 7/site- packages/ selenium/ webdriver/ remote/ webdriver. py", line 252, in start_session Command. NEW_SESSION, parameters) python3. 7/site- packages/ selenium/ webdriver/ remote/ webdriver. py", line 321, in execute error_handler. check_response( response) python3. 7/site- packages/ selenium/ webdriver/ remote/ errorhandler. py", line 242, in check_response class(message, screen, stacktrace) common. exceptions. TimeoutExceptio n: Message: connection refused
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 5, in _get_driver
File "/env/lib/
keep_
File "/env/lib/
self.
File "/env/lib/
response = self.execute(
File "/env/lib/
self.
File "/env/lib/
raise exception_
selenium.