У меня на сервере запущено приложение с версиями этих пакетов:
geckodriver - 0.24.0
python - 3,6,9
firefox - 68,5,0 эс
селен - 3,141,0
Я обновил firefox локально до этой версии:
Я получаю эту ошибку, когда я попробуйте запустить приложение:
selenium.common.exceptions.WebDriverException: Message: connection refused
Это результат файла 'geckodriver.log':
1587486155678 mozrunner::runner DEBUG Killing process 56
1587486155682 webdriver::server DEBUG <- 500 Internal Server Error {"value":{"error":"unknown error","message":"connection refused","stacktrace":""}}
Почему это происходит? Согласно сопоставлению между выпусками geckodriver и требуемыми версиями Selenium и Firefox не должно быть проблем совместимости.
Полный журнал ошибок:
superset-worker_1 | Traceback (most recent call last):
superset-worker_1 | File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 385, in trace_task
superset-worker_1 | R = retval = fun(*args, **kwargs)
superset-worker_1 | File "/app/superset/app.py", line 114, in __call__
superset-worker_1 | return task_base.__call__(self, *args, **kwargs)
superset-worker_1 | File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 650, in __protected_call__
superset-worker_1 | return self.run(*args, **kwargs)
superset-worker_1 | File "/app/superset/tasks/schedules.py", line 373, in schedule_email_report
superset-worker_1 | deliver_dashboard(schedule)
superset-worker_1 | File "/app/superset/tasks/schedules.py", line 211, in deliver_dashboard
superset-worker_1 | driver = create_webdriver()
superset-worker_1 | File "/app/superset/tasks/schedules.py", line 163, in create_webdriver
superset-worker_1 | driver = driver_class(**kwargs)
superset-worker_1 | File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
superset-worker_1 | keep_alive=True)
superset-worker_1 | File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
superset-worker_1 | self.start_session(capabilities, browser_profile)
superset-worker_1 | File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
superset-worker_1 | response = self.execute(Command.NEW_SESSION, parameters)
superset-worker_1 | File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
superset-worker_1 | self.error_handler.check_response(response)
superset-worker_1 | File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
superset-worker_1 | raise exception_class(message, screen, stacktrace)
superset-worker_1 | selenium.common.exceptions.WebDriverException: Message: connection refused
Python код:
WEBDRIVER_CONFIGURATION: Dict[Any, Any] = {'log_path': '/app/superset/geckodriver.log'}
def create_webdriver():
driver_class = firefox.webdriver.WebDriver
options = firefox.options.Options()
options.log.level = "debug"
options.add_argument("--headless")
# Prepare args for the webdriver inits
kwargs = dict(options=options)
kwargs.update(WEBDRIVER_CONFIGURATION)
# Initialize the driver
driver = driver_class(**kwargs)
# Some webdrivers need an initial hit to the welcome URL
# before we set the cookie
welcome_url = _get_url_path("Superset.welcome")
# Hit the welcome URL and check if we were asked to login
driver.get(welcome_url)
# ... code continues