Max retries exceeded with url

ZL4353
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 976, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 308, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 172, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 725, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /quote/ltp?i=NFO%3ABANKNIFTY21JUNFUT (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "strangle_fix_point_strategy_real.py", line 161, in
ce_dict, pe_dict = algo.place_order()
File "strangle_fix_point_strategy_real.py", line 117, in place_order
bn_fut_dict = self.get_ltp(bn_symbol)
File "strangle_fix_point_strategy_real.py", line 113, in get_ltp
return self.kite.ltp(list_symbols)
File "/usr/local/lib/python3.7/site-packages/kiteconnect/connect.py", line 595, in ltp
return self._get("market.quote.ltp", {"i": ins})
File "/usr/local/lib/python3.7/site-packages/kiteconnect/connect.py", line 817, in _get
return self._request(route, "GET", params)
File "/usr/local/lib/python3.7/site-packages/kiteconnect/connect.py", line 865, in _request
raise e
File "/usr/local/lib/python3.7/site-packages/kiteconnect/connect.py", line 862, in _request
proxies=self.proxies)
File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /quote/ltp?i=NFO%3ABANKNIFTY21JUNFUT (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 101] Network is unreachable'))
  • ZL4353
    I am seeing this first time, algo was running since last 3 month. I tried multiple time, got similar error. And then worked after 15 min. which is not acceptable in my algo. Please help.
  • sujith
    Where are you hosted? This seems like a connectivity issue on the client-side.
  • ZL4353
    It's a vm hosted on one server in Bangalore, Which is connected to internet 24/7.
  • rakeshr
    urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 101] Network is unreachable
    It's a vm hosted on one server in Bangalore
    Seems like you need to open outbound ports to access this. You will have to check more on this with your hosted VM admin.
  • ZL4353
    Hi Rakesh, I already mentioned, it worked after few minute. Anyway i am the admin for this VM, and it had outbond access. Same thing happened today again around 8AM. Have not see so frequent in last 3 month.
Sign In or Register to comment.