Я установил проект Django с Apache2 и mod_wsgi на Ubuntu 16.04 экземпляр AWS.Теперь я получаю urllib3.exceptions.ProtocolError: ('Соединение прервано.', ConnectionResetErr или (104, 'Соединение сброшено по одноранговому соединению')), когда я пытаюсь получить доступ к mysite.
Я перепробовал почти все предложенныена stackoverflow и другие ссылки.но не повезло.
[Mon Jan 28 21:02:52.263398 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] Traceback (most recent call last):
[Mon Jan 28 21:02:52.263457 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
[Mon Jan 28 21:02:52.263537 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] chunked=chunked)
[Mon Jan 28 21:02:52.263613 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
[Mon Jan 28 21:02:52.263655 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] six.raise_from(e, None)
[Mon Jan 28 21:02:52.263707 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "<string>", line 2, in raise_from
[Mon Jan 28 21:02:52.263760 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 380, in _make_request
[Mon Jan 28 21:02:52.263799 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] httplib_response = conn.getresponse()
[Mon Jan 28 21:02:52.263851 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
[Mon Jan 28 21:02:52.263903 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response.begin()
[Mon Jan 28 21:02:52.263943 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 297, in begin
[Mon Jan 28 21:02:52.263995 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] version, status, reason = self._read_status()
[Mon Jan 28 21:02:52.264032 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
[Mon Jan 28 21:02:52.264086 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[Mon Jan 28 21:02:52.264129 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/socket.py", line 586, in readinto
[Mon Jan 28 21:02:52.264165 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self._sock.recv_into(b)
[Mon Jan 28 21:02:52.264200 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] ConnectionResetError: [Errno 104] Connection reset by peer
[Mon Jan 28 21:02:52.264234 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898]
[Mon Jan 28 21:02:52.264268 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] During handling of the above exception, another exception occurred:
[Mon Jan 28 21:02:52.302940 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898]
[Mon Jan 28 21:02:52.302961 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] Traceback (most recent call last):
[Mon Jan 28 21:02:52.302991 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/core/handlers/except ion.py", line 34, in inner
[Mon Jan 28 21:02:52.302994 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = get_response(request)
[Mon Jan 28 21:02:52.302996 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/core/handlers/base.p y", line 126, in _get_response
[Mon Jan 28 21:02:52.302999 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = self.process_exception_by_middleware(e, request)
[Mon Jan 28 21:02:52.303001 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/core/handlers/base.p y", line 124, in _get_response
[Mon Jan 28 21:02:52.303004 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Mon Jan 28 21:02:52.303006 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/django/views/decorators/csr f.py", line 54, in wrapped_view
[Mon Jan 28 21:02:52.303009 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return view_func(*args, **kwargs)
[Mon Jan 28 21:02:52.303011 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/home/jshree/Dscrapper/soqqlesocial/data_scrapper/views.py", line 63 , in request_page
[Mon Jan 28 21:02:52.303014 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] twitter.scrap_tweets(rDate, rDatePre, uName, lName)
[Mon Jan 28 21:02:52.303017 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/home/jshree/Dscrapper/soqqlesocial/twitter.py", line 48, in scrap_t weets
[Mon Jan 28 21:02:52.303019 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] drw = webdriver.Chrome(executable_path='/usr/bin/chromedriver', options= options)
[Mon Jan 28 21:02:52.303021 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/chrome/w ebdriver.py", line 81, in __init__
[Mon Jan 28 21:02:52.303024 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] desired_capabilities=desired_capabilities)
[Mon Jan 28 21:02:52.303026 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/w ebdriver.py", line 157, in __init__
[Mon Jan 28 21:02:52.303029 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] self.start_session(capabilities, browser_profile)
[Mon Jan 28 21:02:52.303031 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/w ebdriver.py", line 252, in start_session
[Mon Jan 28 21:02:52.303034 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = self.execute(Command.NEW_SESSION, parameters)
[Mon Jan 28 21:02:52.303036 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/w ebdriver.py", line 319, in execute
[Mon Jan 28 21:02:52.303038 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = self.command_executor.execute(driver_command, params)
[Mon Jan 28 21:02:52.303041 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/r emote_connection.py", line 374, in execute
[Mon Jan 28 21:02:52.303043 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self._request(command_info[0], url, body=data)
[Mon Jan 28 21:02:52.303048 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/selenium/webdriver/remote/r emote_connection.py", line 397, in _request
[Mon Jan 28 21:02:52.303051 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] resp = self._conn.request(method, url, body=body, headers=headers)
[Mon Jan 28 21:02:52.303053 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/request.py", line 7 2, in request
[Mon Jan 28 21:02:52.303056 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] **urlopen_kw)
[Mon Jan 28 21:02:52.303058 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/request.py", line 1 50, in request_encode_body
[Mon Jan 28 21:02:52.303060 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self.urlopen(method, url, **extra_kw)
[Mon Jan 28 21:02:52.303063 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/poolmanager.py", li ne 323, in urlopen
[Mon Jan 28 21:02:52.303065 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response = conn.urlopen(method, u.request_uri, **kw)
[Mon Jan 28 21:02:52.303067 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
[Mon Jan 28 21:02:52.303070 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] _stacktrace=sys.exc_info()[2])
[Mon Jan 28 21:02:52.303072 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/util/retry.py", lin e 367, in increment
[Mon Jan 28 21:02:52.303075 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] raise six.reraise(type(error), error, _stacktrace)
[Mon Jan 28 21:02:52.303077 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/packages/six.py", l ine 685, in reraise
[Mon Jan 28 21:02:52.303079 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] raise value.with_traceback(tb)
[Mon Jan 28 21:02:52.303082 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
[Mon Jan 28 21:02:52.303084 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] chunked=chunked)
[Mon Jan 28 21:02:52.303086 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
[Mon Jan 28 21:02:52.303089 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] six.raise_from(e, None)
[Mon Jan 28 21:02:52.303091 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "<string>", line 2, in raise_from
[Mon Jan 28 21:02:52.303093 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/var/www/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 380, in _make_request
[Mon Jan 28 21:02:52.303096 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] httplib_response = conn.getresponse()
[Mon Jan 28 21:02:52.303098 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
[Mon Jan 28 21:02:52.303100 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] response.begin()
[Mon Jan 28 21:02:52.303105 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 297, in begin
[Mon Jan 28 21:02:52.303107 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] version, status, reason = self._read_status()
[Mon Jan 28 21:02:52.303110 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/http/client.py", line 258, in _read_status
[Mon Jan 28 21:02:52.303112 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
[Mon Jan 28 21:02:52.303114 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] File "/usr/lib/python3.6/socket.py", line 586, in readinto
[Mon Jan 28 21:02:52.303117 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] return self._sock.recv_into(b)
[Mon Jan 28 21:02:52.303124 2019] [wsgi:error] [pid 27292:tid 140652916205312] [remote 172.31.25.223:61898] urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetErr or(104, 'Connection reset by peer'))
update
Я использовал флаг запроса-тайм-аута в файле Apache Conf, с помощью которого я избавился от этой ошибки, но все еще получаю 504 Время шлюза-out страница ошибки после некоторого времени ожидания.Любая идея, чтобы избавиться от этого или справиться с этим.