Всем привет, ситуация следующая:
На удалённом сервере работает селен (бот), через несколько часов непрерывной работы от падает с ошибкой
HTTPConnectionPool(host='localhost', port=46525): Max retries exceeded with url...
Полный трэйсбэк
HTTPConnectionPool(host='127.0.0.1', port=48457): Max retries exceeded with url: /session/76af77e47285142cc188ed81e217fbb4/source (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))
2019-06-14 17:44:04.270078
Traceback (most recent call last):
File "/root/.local/lib/python3.7/site-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/root/.local/lib/python3.7/site-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/root/.local/lib/python3.7/site-packages/urllib3/util/connection.py", line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/root/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/root/.local/lib/python3.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 374, in execute
return self._request(command_info[0], url, body=data)
File "/root/.local/lib/python3.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 397, in _request
resp = self._conn.request(method, url, body=body, headers=headers)
File "/root/.local/lib/python3.7/site-packages/urllib3/request.py", line 68, in request
**urlopen_kw)
File "/root/.local/lib/python3.7/site-packages/urllib3/request.py", line 89, in request_encode_url
return self.urlopen(method, url, **extra_kw)
File "/root/.local/lib/python3.7/site-packages/urllib3/poolmanager.py", line 323, in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
File "/root/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 667, in urlopen
**response_kw)
File "/root/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 667, in urlopen
**response_kw)
File "/root/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 667, in urlopen
**response_kw)
File "/root/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/root/.local/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=48457): Max retries exceeded with url: /session/76af77e47285142cc188ed81e217fbb4/window (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused'))
urllib3==1.24.1
selenium==3.141.0
Читал что это должны были пофиксить как раз в версии 3.141 , но самое забавное что на этом же сервере буквально месяц назад скрипт работал в течении 40 дней без перерыва и вполне исправно. Подскажите что попробовать?
p.s делал и слипы, и даже перезагрузку в случае исключения, но это увы не помогает даже при перегрузки вебдрайвера с выгрузкой из памяти. Подумал даже может провайдер может что-то ограничивает?