Open tze-min opened 3 years ago
I am having a similar issue, this seems to be some form of network problem. In my case, docker runs ok with elasticsearch and then when I try geoparse I get a connection error. I have switched online networks to no avail; I don't have a firewall up and am using a Mac. I have used the suggested code to run docker etc.
> GET http://localhost:9200/geonames/_count [status:N/A request:0.618s]
> Traceback (most recent call last):
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, 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/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 114, in perform_request
> response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
> _stacktrace=sys.exc_info()[2])
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/util/retry.py", line 344, in increment
> raise six.reraise(type(error), error, _stacktrace)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
> raise value.with_traceback(tb)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, in _read_status
> raise RemoteDisconnected("Remote end closed connection without"
> urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
> GET http://localhost:9200/geonames/_count [status:N/A request:0.333s]
> Traceback (most recent call last):
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, 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/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 114, in perform_request
> response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
> _stacktrace=sys.exc_info()[2])
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/util/retry.py", line 344, in increment
> raise six.reraise(type(error), error, _stacktrace)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
> raise value.with_traceback(tb)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, in _read_status
> raise RemoteDisconnected("Remote end closed connection without"
> urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
> GET http://localhost:9200/geonames/_count [status:N/A request:0.217s]
> Traceback (most recent call last):
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, 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/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 114, in perform_request
> response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
> _stacktrace=sys.exc_info()[2])
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/util/retry.py", line 344, in increment
> raise six.reraise(type(error), error, _stacktrace)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
> raise value.with_traceback(tb)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, in _read_status
> raise RemoteDisconnected("Remote end closed connection without"
> urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
> GET http://localhost:9200/geonames/_count [status:N/A request:0.514s]
> Traceback (most recent call last):
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, 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/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py", line 114, in perform_request
> response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
> _stacktrace=sys.exc_info()[2])
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/util/retry.py", line 344, in increment
> raise six.reraise(type(error), error, _stacktrace)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
> raise value.with_traceback(tb)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
> chunked=chunked)
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 384, in _make_request
> six.raise_from(e, None)
> File "<string>", line 2, in raise_from
> File "/opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py", line 380, in _make_request
> httplib_response = conn.getresponse()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 1336, in getresponse
> response.begin()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 306, in begin
> version, status, reason = self._read_status()
> File "/opt/anaconda3/lib/python3.7/http/client.py", line 275, in _read_status
> raise RemoteDisconnected("Remote end closed connection without"
> urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
>
> ---------------------------------------------------------------------------
> RemoteDisconnected Traceback (most recent call last)
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
> 599 body=body, headers=headers,
> --> 600 chunked=chunked)
> 601
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
> 383 # otherwise it looks like a programming error was the cause.
> --> 384 six.raise_from(e, None)
> 385 except (SocketTimeout, BaseSSLError, SocketError) as e:
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/packages/six.py in raise_from(value, from_value)
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
> 379 try:
> --> 380 httplib_response = conn.getresponse()
> 381 except Exception as e:
>
> /opt/anaconda3/lib/python3.7/http/client.py in getresponse(self)
> 1335 try:
> -> 1336 response.begin()
> 1337 except ConnectionError:
>
> /opt/anaconda3/lib/python3.7/http/client.py in begin(self)
> 305 while True:
> --> 306 version, status, reason = self._read_status()
> 307 if status != CONTINUE:
>
> /opt/anaconda3/lib/python3.7/http/client.py in _read_status(self)
> 274 # sending a valid response.
> --> 275 raise RemoteDisconnected("Remote end closed connection without"
> 276 " response")
>
> RemoteDisconnected: Remote end closed connection without response
>
> During handling of the above exception, another exception occurred:
>
> ProtocolError Traceback (most recent call last)
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py in perform_request(self, method, url, params, body, timeout, ignore)
> 113
> --> 114 response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
> 115 duration = time.time() - start
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
> 637 retries = retries.increment(method, url, error=e, _pool=self,
> --> 638 _stacktrace=sys.exc_info()[2])
> 639 retries.sleep()
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
> 343 # Disabled, indicate to re-raise the error.
> --> 344 raise six.reraise(type(error), error, _stacktrace)
> 345
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/packages/six.py in reraise(tp, value, tb)
> 684 if value.__traceback__ is not tb:
> --> 685 raise value.with_traceback(tb)
> 686 raise value
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
> 599 body=body, headers=headers,
> --> 600 chunked=chunked)
> 601
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
> 383 # otherwise it looks like a programming error was the cause.
> --> 384 six.raise_from(e, None)
> 385 except (SocketTimeout, BaseSSLError, SocketError) as e:
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/packages/six.py in raise_from(value, from_value)
>
> /opt/anaconda3/lib/python3.7/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
> 379 try:
> --> 380 httplib_response = conn.getresponse()
> 381 except Exception as e:
>
> /opt/anaconda3/lib/python3.7/http/client.py in getresponse(self)
> 1335 try:
> -> 1336 response.begin()
> 1337 except ConnectionError:
>
> /opt/anaconda3/lib/python3.7/http/client.py in begin(self)
> 305 while True:
> --> 306 version, status, reason = self._read_status()
> 307 if status != CONTINUE:
>
> /opt/anaconda3/lib/python3.7/http/client.py in _read_status(self)
> 274 # sending a valid response.
> --> 275 raise RemoteDisconnected("Remote end closed connection without"
> 276 " response")
>
> ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
>
> During handling of the above exception, another exception occurred:
>
> ConnectionError Traceback (most recent call last)
> /opt/anaconda3/lib/python3.7/site-packages/mordecai/geoparse.py in __init__(self, nlp, es_hosts, es_port, es_ssl, es_auth, verbose, country_threshold, threads, progress, training, models_path, **kwargs)
> 70 # with nostderr():
> ---> 71 self.conn.count()
> 72 except:
>
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch_dsl/search.py in count(self)
> 586 body=d,
> --> 587 **self._params
> 588 )['count']
>
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch/client/utils.py in _wrapped(*args, **kwargs)
> 72 params[p] = kwargs.pop(p)
> ---> 73 return func(*args, params=params, **kwargs)
> 74 return _wrapped
>
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch/client/__init__.py in count(self, index, doc_type, body, params)
> 1122 return self.transport.perform_request('GET', _make_path(index,
> -> 1123 doc_type, '_count'), params=params, body=body)
> 1124
>
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch/transport.py in perform_request(self, method, url, params, body)
> 311 try:
> --> 312 status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)
> 313
>
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch/connection/http_urllib3.py in perform_request(self, method, url, params, body, timeout, ignore)
> 122 raise ConnectionTimeout('TIMEOUT', str(e), e)
> --> 123 raise ConnectionError('N/A', str(e), e)
> 124
>
> ConnectionError: ConnectionError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))) caused by: ProtocolError(('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')))
>
> During handling of the above exception, another exception occurred:
>
> ConnectionError Traceback (most recent call last)
> /opt/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_code(self, code_obj, result, async_)
> 3325 else:
> -> 3326 exec(code_obj, self.user_global_ns, self.user_ns)
> 3327 finally:
>
> <ipython-input-18-e748618d2018> in <module>
> ----> 1 geo = Geoparser()
> 2 test_result = geo.geoparse(test_string)
> 3 print(test_result)
>
> /opt/anaconda3/lib/python3.7/site-packages/mordecai/geoparse.py in __init__(self, nlp, es_hosts, es_port, es_ssl, es_auth, verbose, country_threshold, threads, progress, training, models_path, **kwargs)
> 76 See https://github.com/openeventdata/mordecai#installation-and-requirements
> ---> 77 for instructions on setting up Geonames/Elasticsearch""".format(es_hosts, es_port))
> 78 es_date = utilities.check_geonames_date(self.conn)
>
> <class 'str'>: (<class 'IndexError'>, IndexError('tuple index out of range'))
>
> During handling of the above exception, another exception occurred:
>
> IndexError Traceback (most recent call last)
> /opt/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_code(self, code_obj, result, async_)
> 3341 if result is not None:
> 3342 result.error_in_exec = sys.exc_info()[1]
> -> 3343 self.showtraceback(running_compiled_code=True)
> 3344 else:
> 3345 outflag = False
>
> /opt/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py in showtraceback(self, exc_tuple, filename, tb_offset, exception_only, running_compiled_code)
> 2043 value, tb, tb_offset=tb_offset)
> 2044
> -> 2045 self._showtraceback(etype, value, stb)
> 2046 if self.call_pdb:
> 2047 # drop into debugger
>
> /opt/anaconda3/lib/python3.7/site-packages/ipykernel/zmqshell.py in _showtraceback(self, etype, evalue, stb)
> 544 u'traceback' : stb,
> 545 u'ename' : unicode_type(etype.__name__),
> --> 546 u'evalue' : py3compat.safe_unicode(evalue),
> 547 }
> 548
>
> /opt/anaconda3/lib/python3.7/site-packages/ipython_genutils/py3compat.py in safe_unicode(e)
> 63 """
> 64 try:
> ---> 65 return unicode_type(e)
> 66 except UnicodeError:
> 67 pass
>
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch/exceptions.py in __str__(self)
> 67 def __str__(self):
> 68 return 'ConnectionError(%s) caused by: %s(%s)' % (
> ---> 69 self.error, self.info.__class__.__name__, self.info)
> 70
> 71
>
> /opt/anaconda3/lib/python3.7/site-packages/elasticsearch/exceptions.py in error(self)
> 42 def error(self):
> 43 """ A string error message. """
> ---> 44 return self.args[1]
> 45
> 46 @property
>
> IndexError: tuple index out of range
>
>
I'm having a similar issue on MacOS. Seems like the docker container crashed just after a few requests I made with curl
Seems like this issue is specific to MacOS. I didn't encounter it when trying out mordecai on Ubuntu.
To update, I'd opened the issue those months back because I'd encountered the problem on my Windows 10 PC, but I remember I'd resolved it by connecting to a more stable Internet network. I can't comment on why it's not working on MacOS though.
Thanks, I will see what I can do!
On Sun, Nov 28, 2021 at 10:03 AM Tze Min @.***> wrote:
To update, I'd opened the issue those months back because I'd encountered the problem on my Windows 10 PC, but I remember I'd resolved it by connecting to a more stable Internet network. I can't comment on why it's not working on MacOS though.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openeventdata/mordecai/issues/102#issuecomment-981100634, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQAAQBGREGU4NOEAJJEVO7TUOJAF3ANCNFSM5CGCXDCQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hello! I was working through the installation steps when I ran into a problem with
geo = Geoparser()
. It isn't able to establish a connection with elasticsearch, though Docker Desktop tells me elasticsearch:5.5.2 is running, and I'm not really sure what's wrong. I would appreciate any help.The error message is as below.