Shnezzin / breitbandmessung

Perform breitbandmessung.de speedtests in an automated way
4 stars 2 forks source link

WebDriverException on armv7l #8

Closed varac closed 1 year ago

varac commented 2 years ago

I try to run breitbandmessung on a Raspberry Pi 4 Model B Rev 1.1. However, I get this:

pi@mediaplayer:~/breitbandmessung $ sudo docker run --rm -v $PWD/config/:/usr/src/app/config:rw -v $PWD/messprotokolle:/export/ --name "breitbandmessung" shneezin/breitbandmessung
Setting timezone: UTC
Run on startup: true

Open Browser
Traceback (most recent call last):
  File "/usr/src/app/speedtest.py", line 88, in <module>
    browser = webdriver.Firefox(options=fireFoxOptions)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/firefox/webdriver.py", line 172, in __init__
    self.service.start()
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 98, in start
    self.assert_process_still_running()
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/common/service.py", line 110, in assert_process_still_running
    raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: Service geckodriver unexpectedly exited. Status code was: 1

pi@mediaplayer:~/breitbandmessung $ uname -a
Linux mediaplayer 5.15.32-v7l+ #1538 SMP Thu Mar 31 19:39:41 BST 2022 armv7l GNU/Linux

From looking at geckodriver.sh, the armv7l arch should be supported. Any ideas why it breaks ?

Shnezzin commented 2 years ago

Yes, I know what the problem is. Geckodriver expects libc6 with GLIBC 2.34. But only GLIBC 2.33 is available in the official Debian repos. As soon as I have a solution, I will publish a fix.

varac commented 2 years ago

For current raspbian (bullseye) only 2.31 seems to be available:

pi@mediaplayer:~ $ apt policy libc6
libc6:
  Installiert:           2.31-13+rpt2+rpi1+deb11u3
  Installationskandidat: 2.31-13+rpt2+rpi1+deb11u3
  Versionstabelle:
 *** 2.31-13+rpt2+rpi1+deb11u3 500
        500 http://archive.raspberrypi.org/debian bullseye/main armhf Packages
        100 /var/lib/dpkg/status
     2.31-13+rpi1+deb11u3 500
        500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages

Would an earlier version of geckdriver help, which only depend on this version ?

varac commented 2 years ago

Also, I'm struggeling to understand, but the current docker image is build from python:slim-bullseye, which also ships libc6 2.31:

❯ docker run --rm -it python:slim-bullseye bash
root@3ed96a0ea1ea:/# dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version         Architecture Description
+++-==============-===============-============-=================================
ii  libc6:amd64    2.31-13+deb11u3 amd64        GNU C Library: Shared libraries
Shnezzin commented 2 years ago

I have been looking at the problems over the last few days and have found a solution. I am currently testing it on a system and will release it in the next few days if there are no problems. You can also test it yourself and see if you have problems. You can find the images on Dockerhub under the tag test.

shneezin/breitbandmessung:test

varac commented 2 years ago

I tested both :test and curent :latest, and the original error is gone now, thanks ! However, I repeatedly hit this error while trying:

pi@pi:~/breitbandmessung $ sudo docker run --rm -v $PWD/config/:/usr/src/app/config:rw -v $PWD/messprotokolle:/export/ --name "breitbandmessung" shneezin/breitbandmessung
Setting timezone: Europe/Berlin                                                                                                                                                                                             
Run on startup: true

Open Browser
Traceback (most recent call last):
  File "/usr/src/app/speedtest.py", line 93, in <module>
    browser.get(TEST_URL)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 446, in get
    self.execute(Command.GET, {'url': url})
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 434, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Reached error page: about:neterror?e=dnsNotFound&u=https%3A//breitbandmessung.de/test&c=UTF-8&d=We%20can%E2%80%99t%20connect%20to%20the%20server%20at%20breitbandmessung.de.
Stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5
UnknownError@chrome://remote/content/shared/webdriver/Errors.jsm:488:5
checkReadyState@chrome://remote/content/marionette/navigate.js:64:24
onNavigation@chrome://remote/content/marionette/navigate.js:312:39
emit@resource://gre/modules/EventEmitter.jsm:160:20
receiveMessage@chrome://remote/content/marionette/actors/MarionetteEventsParent.jsm:42:25
Shnezzin commented 2 years ago

It looks to me like your DNS server, which is configured on the system, is not resolving correctly. Can you start the container once with the addition --dns <external dns>. For example sudo docker run -d -v $PWD/config/:/usr/src/app/config:rw -v $PWD/measurementlogs:/export/ --dns 9.9.9.9 --name "broadbandmeasurement" shneezin/broadbandmeasurement