Read timed out !!!


  • 2a1f9c21-21a6-4ae3-b3f1-904dc1982f8c-image.png

    from morning 9:15 to 3:30 pm I got totally 18 times tis error !!!

    of course because of try and exception handling we could manage - otherwise it would have been a major hurdle in our Algo !

    if same things continue in one stroke for long period then defiantly our Algo also fails in spite of Try and Exeption !

    The Angel should increase the necessary hardware and bandwidth to handle the increasing demand and traffic .

    @Moderator_1
    @Moderator_2


  • Have you found any solution regarding Read Timed out?
    I am also receiving same error frequently!!!


  • Hello @Shyam-Ranasara

    Kindly check your TLS version is the updated one or not .

    Regards,
    SmartAPI Team


  • Hey @admin i got readtime out error 15 times from 9.00 to 9.35 please help me to find some solution

    Description of error:-
    Request: {'mode': 'FULL', 'exchangeTokens': {'NSE': ['881', '29553', '4717', '3045', '14977'], 'NFO': [], 'BSE': [], 'MCX': [], 'CDS': [], 'NCDEX': []}}, Response: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=7)
    [E 240603 09:25:33 api_call:77] Get Market data Api failedHTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=7)
    Traceback (most recent call last):
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
    self._validate_conn(conn)
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 1099, in _validate_conn
    conn.connect()
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py", line 653, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py", line 806, in ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
    ^^^^^^^^^^^^^^^^
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\util\ssl
    .py", line 465, in ssl_wrap_socket
    ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\util\ssl
    .py", line 509, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\ssl.py", line 455, in wrap_socket
    return self.sslsocket_class._create(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\ssl.py", line 1042, in _create
    self.do_handshake()
    File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\ssl.py", line 1320, in do_handshake
    self._sslobj.do_handshake()
    TimeoutError: _ssl.c:983: The handshake operation timed out

    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\adapters.py", line 589, in send
        resp = conn.urlopen(
               ^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 847, in urlopen
        retries = retries.increment(
                  ^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\util\retry.py", line 470, in increment
        raise reraise(type(error), error, _stacktrace)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\util\util.py", line 39, in reraise
        raise value
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 793, in urlopen
        response = self._make_request(
                   ^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request
        raise new_e
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 469, in _make_request
        self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py", line 370, in _raise_timeout
        raise ReadTimeoutError(
    urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=7)
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Users\r_ran\Desktop\Shyam\Stock Market\Ravi Project\angle one\api_call.py", line 73, in Get_Market_Data
        data = self.smartApi.getMarketData(mode=mode , exchangeTokens=exchange_token)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\smartConnect.py", line 470, in getMarketData
        marketDataResult=self._postRequest("api.market.data",params)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\smartConnect.py", line 260, in _postRequest
        return self._request(route, "POST", params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\smartConnect.py", line 219, in _request
        raise e
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\smartConnect.py", line 207, in _request
        r = requests.request(method,
            ^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\api.py", line 59, in request
        return session.request(method=method, url=url, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 589, in request
        resp = self.send(prep, **send_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 703, in send
        r = adapter.send(request, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\r_ran\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\adapters.py", line 635, in send
        raise ReadTimeout(e, request=request)
    requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=7)

  • I had reported this timeout issue some weeks back, and now it occurs quite often espcially yesterday. I request the admins to have a look at this and sort this at the earlies to increase the reliability of SmartAPI. @admin @Moderator_1 @Moderator_2


  • @Mnagesh
    I completely agree with you. There has to be additional support regarding the timeout form the Smart API team.
    @Moderator_1 @Moderator_2 @admin


  • @Mnagesh why?


  • @Mnagesh
    today 10 times this read time out occurred
    but not an issue manageable