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)