---------------------------------------------------------------------------
ConnectionRefusedError Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py in _new_conn(self)
173 try:
--> 174 conn = connection.create_connection(
175 (self._dns_host, self.port), self.timeout, **extra_kw
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
94 if err is not None:
---> 95 raise err
96
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
84 sock.bind(source_address)
---> 85 sock.connect(sa)
86 return sock
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/connection/http_urllib3.py in perform_request(self, method, url, params, body, timeout, ignore, headers)
254
--> 255 response = self.pool.urlopen(
256 method, url, body, retries=Retry(False), headers=request_headers, **kw
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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)
784
--> 785 retries = retries.increment(
786 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
524 # Disabled, indicate to re-raise the error.
--> 525 raise six.reraise(type(error), error, _stacktrace)
526
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/packages/six.py in reraise(tp, value, tb)
769 raise value.with_traceback(tb)
--> 770 raise value
771 finally:
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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)
702 # Make the request on the httplib connection object.
--> 703 httplib_response = self._make_request(
704 conn,
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
397 else:
--> 398 conn.request(method, url, **httplib_request_kw)
399
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py in request(self, method, url, body, headers)
238 headers["User-Agent"] = _get_default_user_agent()
--> 239 super(HTTPConnection, self).request(method, url, body=body, headers=headers)
240
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py in request(self, method, url, body, headers, encode_chunked)
1281 """Send a complete request to the server."""
-> 1282 self._send_request(method, url, body, headers, encode_chunked)
1283
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
1327 body = _encode(body, 'body')
-> 1328 self.endheaders(body, encode_chunked=encode_chunked)
1329
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py in endheaders(self, message_body, encode_chunked)
1276 raise CannotSendHeader()
-> 1277 self._send_output(message_body, encode_chunked=encode_chunked)
1278
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py in _send_output(self, message_body, encode_chunked)
1036 del self._buffer[:]
-> 1037 self.send(msg)
1038
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py in send(self, data)
974 if self.auto_open:
--> 975 self.connect()
976 else:
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py in connect(self)
204 def connect(self):
--> 205 conn = self._new_conn()
206 self._prepare_conn(conn)
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/connection.py in _new_conn(self)
185 except SocketError as e:
--> 186 raise NewConnectionError(
187 self, "Failed to establish a new connection: %s" % e
NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10c019300>: Failed to establish a new connection: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
ConnectionError Traceback (most recent call last)
/var/folders/v3/7xgvf6c935j7zk8c78116mrc0000gp/T/ipykernel_83431/1089693102.py in <module>
1 movies = helpers.indexable_movies(movies='data/tmdb.json')
2
----> 3 index.rebuild(client, index='tmdb', doc_src=movies)
~/RiderProjects/hello-ltr-main/ltr/index.py in rebuild(client, index, doc_src, force)
7 """
8
----> 9 if client.check_index_exists(index):
10 if (force):
11 client.delete_index(index)
~/RiderProjects/hello-ltr-main/ltr/client/elastic_client.py in check_index_exists(self, index)
61
62 def check_index_exists(self, index):
---> 63 return self.es.indices.exists(index=index)
64
65 def delete_index(self, index):
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/client/utils.py in _wrapped(*args, **kwargs)
345 if p in kwargs:
346 params[p] = kwargs.pop(p)
--> 347 return func(*args, params=params, headers=headers, **kwargs)
348
349 return _wrapped
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/client/indices.py in exists(self, index, params, headers)
369 raise ValueError("Empty value passed for a required argument 'index'.")
370
--> 371 return self.transport.perform_request(
372 "HEAD", _make_path(index), params=params, headers=headers
373 )
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/transport.py in perform_request(self, method, url, headers, params, body)
415 # Before we make the actual API call we verify the Elasticsearch instance.
416 if self._verified_elasticsearch is None:
--> 417 self._do_verify_elasticsearch(headers=headers, timeout=timeout)
418
419 # If '_verified_elasticsearch' isn't 'True' then we raise an error.
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/transport.py in _do_verify_elasticsearch(self, headers, timeout)
604 # anywhere then we re-raise the more appropriate error.
605 if error and not info_response:
--> 606 raise error
607
608 # Check the information we got back from the index request.
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/transport.py in _do_verify_elasticsearch(self, headers, timeout)
567
568 try:
--> 569 _, info_headers, info_response = conn.perform_request(
570 "GET", "/", headers=headers, timeout=timeout
571 )
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/elasticsearch/connection/http_urllib3.py in perform_request(self, method, url, params, body, timeout, ignore, headers)
278 if isinstance(e, ReadTimeoutError):
279 raise ConnectionTimeout("TIMEOUT", str(e), e)
--> 280 raise ConnectionError("N/A", str(e), e)
281
282 # raise warnings if any from the 'Warnings' header.
ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x10c019300>: Failed to establish a new connection: [Errno 61] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x10c019300>: Failed to establish a new connection: [Errno 61] Connection refused)