kite.ltp failing with requests.exceptions.ReadTimeout on Azure Linux VM

amitjet
Earlier, I used to get random network error on my windows pc. i always used to blame it on my pc and my internet connection. so i build my code to graciously handles this and do series of retries and it works.

Recently, I shifted my code to a Linux VM on Azure. I have started to notice same random errors on Azure as well. here is the most recent one.
I am using Python. the error comes usually on trying to get LTP of a single symbol - which should be lightest of all API call to fetch data. Is there anything wrong on kite connectivity ?

here is the exception stack:
Traceback (most recent call last):
File "/home/azureuser/saral/zerodhaTrader.py", line 284, in get_ltp_by_token
data = self.kite.ltp(symbol_token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/.local/lib/python3.12/site-packages/kiteconnect/connect.py", line 611, in ltp
return self._get("market.quote.ltp", params={"i": ins})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/.local/lib/python3.12/site-packages/kiteconnect/connect.py", line 861, in _get
return self._request(route, "GET", url_args=url_args, params=params, is_json=is_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/.local/lib/python3.12/site-packages/kiteconnect/connect.py", line 916, in _request
raise e
File "/home/azureuser/.local/lib/python3.12/site-packages/kiteconnect/connect.py", line 904, in _request
r = self.reqsession.request(method,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/.local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/.local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/.local/lib/python3.12/site-packages/requests/adapters.py", line 690, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
  • Nivas
    We haven't encountered any issues on our end. However, please let us know if you encounter similar problems in the future.
Sign In or Register to comment.