Connection refused and timed out error

Using elasticsearch 5.4.0 with python library 5.4.0. The initial connection gets established fine, any add requests later ends up with a connection refused error. Updated elasticsearch to 5.5.0 and I am still seeing the same issue. Kibana(5.5.0) shows an error that it is not compatible with 5.4.0, after updating to elasticsearch 5.5.0 Kibana error message was showing as "Elasticsearch is still initializing the kibana index."

Had to clear the data directory and start fresh and everything worked fine. Now I am not able migrate to my old data.

How do I fix this. I verified the connection, and I am able to send HTTP requests using CURL and properly getting back responses.

curl -XGET http://localhost:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open medicscity 2P_M0bZHQIWOXVzbbVl8mA 5 1 1 0 6.1kb 6.1kb
red open .kibana dlmUMgW4S2-jfUr1n3bRow 1 1
yellow open eldam l0WvZmPcQQaopVbj8UEFvQ 5 1 0 0 955b 955b

Traceback (most recent call last):
File "/home/ekam/devel/medics_city/lib/python3.5/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 "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/util/retry.py", line 333, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/packages/six.py", line 686, in reraise
raise value
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connectionpool.py", line 357, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connection.py", line 166, in connect
conn = self._new_conn()
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f4cffd29358>: Failed to establish a new connection: [Errno 111] Connection refused

response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/util/retry.py", line 333, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/packages/six.py", line 686, in reraise
raise value
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
chunked=chunked)
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connectionpool.py", line 389, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/home/ekam/devel/medics_city/lib/python3.5/site-packages/urllib3/connectionpool.py", line 309, in _raise_timeout
raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=9200): Read timed out. (read timeout=10)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.