parsedmarc icon indicating copy to clipboard operation
parsedmarc copied to clipboard

throws exception on startup: "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request(

Open vasyugan opened this issue 1 year ago • 2 comments

I've installed parsedmarc on Debian Bookworm in virtualenv as decribed here:

On startup it throws the following exception and exits immediately, unfortunately without saying what url it is, that it fails to open.

(venv) :/opt/parsedmarc/venv$ parsedmarc -c /etc/parsedmarc.ini 
Traceback (most recent call last):
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 462, in _make_request
    httplib_response = conn.getresponse()
                       ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib/python3.11/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch/connection/http_urllib3.py", line 251, in perform_request
    response = self.pool.urlopen(
               ^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 801, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/util/retry.py", line 527, in increment
    raise six.reraise(type(error), error, _stacktrace)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 715, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 467, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 462, in _make_request
    httplib_response = conn.getresponse()
                       ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 1374, in getresponse
    response.begin()
  File "/usr/lib/python3.11/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
                              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 287, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/parsedmarc/venv/bin/parsedmarc", line 8, in <module>
    sys.exit(_main())
             ^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/parsedmarc/cli.py", line 1047, in _main
    elastic.migrate_indexes(aggregate_indexes=[es_aggregate_index],
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/parsedmarc/elastic.py", line 315, in migrate_indexes
    if not Index(aggregate_index_name).exists():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch_dsl/index.py", line 414, in exists
    return self._get_connection(using).indices.exists(index=self._name, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch/client/utils.py", line 168, in _wrapped
    return func(*args, params=params, headers=headers, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch/client/indices.py", line 332, in exists
    return self.transport.perform_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch/transport.py", line 413, in perform_request
    raise e
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch/transport.py", line 381, in perform_request
    status, headers_response, data = connection.perform_request(
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch/connection/http_urllib3.py", line 266, in perform_request
    raise ConnectionError("N/A", str(e), e)
elasticsearch.exceptions.ConnectionError: ConnectionError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))) caused by: ProtocolError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))


vasyugan avatar Aug 18 '24 09:08 vasyugan

I should add that it works on Ubuntu 22.04.

vasyugan avatar Aug 20 '24 09:08 vasyugan

This is the elasticsearch connection ( File "/opt/parsedmarc/venv/lib/python3.11/site-packages/elasticsearch_dsl/index.py", line 414, in exists)

Double-check if SSL is enabled for elasticsearch, and try toggling it if it doesn't work or changing ports

scheibling avatar Oct 25 '24 15:10 scheibling