Getting error while fetching historical data for last 8 days at 5 minute interval.

deadpool
deadpool edited October 1 in Python client
Fetch historical data for token 1347841 on 2025-09-23 failed (attempt 1/3): HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
  • nish12
    i have similar issues for past 1 week

    --- api.kite.trade ping statistics ---
    3222 packets transmitted, 3213 packets received, 0.3% packet loss


    --- google.com ping statistics ---
    3269 packets transmitted, 3269 packets received, 0.0% packet loss
  • Nivas
    We haven't encountered any issues on our end. Could you let us know how frequently you experience this error? Additionally, please enable debug logs in PyKiteConnect and share the complete stack trace with us. Be sure to remove any app and client-specific tokens before sharing.

    I recommend you to test on a different network (for example, a mobile hotspot or another Wi-Fi) to see if the issue is specific to your current ISP.
  • nish12
    every 10-15 requests one will fail, it is happening in all request. For example orders which is executed have returned timeout error. I have tried different connections but same issue. This doesn't happen too often but it happens and can cause serious damage to app logic. I had run ping request to google simultaneously with api.kite.trade and i can see .3% failure for api.kite.trade and 0 failure for google.com. So issue is not about network.

    Traceback (most recent call last):
    File "/mypath/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 468, in _make_request
    six.raise_from(e, None)
    File "", line 3, in raise_from
    File "mypath/.venv/lib/python3.9/site-packages/urllib3/connectionpool.py", line 463, in _make_request
    httplib_response = conn.getresponse()
    File "/mypath/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1349, in getresponse
    response.begin()
    File "/mypath/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 316, in begin
    version, status, reason = self._read_status()
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 277, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
    socket.timeout: The read operation timed out
  • nish12
    I had searched my error logs(usually i store in database) in my log there is not even single error outside trading hours This only happens only during trading hours. I will try connection pooling option not sure this will help. This issue only appeared recently( couple of weeks max)
Sign In or Register to comment.